forked from thoughtbot/ember-cli-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embed a Rails application in `spec/dummy`. Configure `capybara-webkit` for CI according to old [suspenders] configuration. Embed an EmberCLI application in `spec/dummy/my-app`. Exclude from version control. When running `bin/setup`, a generated EmberCLI will be cloned from [kellyselden/ember-cli-output]. [suspenders]: thoughtbot/suspenders@ac3924d [kellyselden/ember-cli-output]: https://github.com/kellyselden/ember-cli-output
- Loading branch information
1 parent
4f3b7c0
commit a658413
Showing
18 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ | |
*.o | ||
*.a | ||
mkmf.log | ||
/log/ | ||
spec/dummy/my-app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
language: ruby | ||
sudo: false | ||
cache: bundler | ||
|
||
notifications: | ||
email: false | ||
|
||
rvm: | ||
- 2.2.0 | ||
- 2.1.0 | ||
- 2.0.0 | ||
|
||
before_install: | ||
- qmake -version | ||
- "echo '--colour' > ~/.rspec" | ||
- "echo 'gem: --no-document' > ~/.gemrc" | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
before_script: bin/setup | ||
script: xvfb-run -a bin/rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
load Gem.bin_path('bundler', 'bundle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env ruby | ||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'rspec' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require 'pathname' | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require 'rubygems' | ||
require 'bundler/setup' | ||
|
||
load Gem.bin_path('rspec-core', 'rspec') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Set up Ruby dependencies via Bundler | ||
gem install bundler --conservative | ||
bundle check || bundle install | ||
|
||
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv | ||
mkdir -p .git/safe | ||
|
||
if ! command -v bower > /dev/null; then | ||
npm install -g bower | ||
fi | ||
|
||
if ! [ -d spec/dummy/my-app ]; then | ||
git clone https://github.com/kellyselden/ember-cli-output.git spec/dummy/my-app | ||
fi | ||
|
||
root="$(pwd)" | ||
|
||
cd ${root}/spec/dummy/my-app && | ||
npm install --save-dev ember-cli-rails-addon && | ||
bower install | ||
|
||
cd ${root}/spec/dummy && bundle exec rake ember:install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
!.keep | ||
*.DS_Store | ||
*.swo | ||
*.swp | ||
/.bundle | ||
/.env | ||
/.foreman | ||
/coverage/* | ||
/db/*.sqlite3 | ||
/log/* | ||
/public/system | ||
/public/assets | ||
/tags | ||
/tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require File.expand_path("../application", __FILE__) | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ApplicationController < ActionController::Base | ||
# Prevent CSRF attacks by raising an exception. | ||
# For APIs, you may want to use :null_session instead. | ||
protect_from_forgery with: :exception | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= include_ember_script_tags "my-app" %> | ||
<%= include_ember_stylesheet_tags "my-app" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Dummy</title> | ||
<%= csrf_meta_tags %> | ||
</head> | ||
<body> | ||
|
||
<%= yield %> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require "rails" | ||
|
||
require "action_controller/railtie" | ||
require "action_view/railtie" | ||
require "sprockets/railtie" | ||
|
||
Bundler.require(*Rails.groups) | ||
|
||
module Dummy | ||
class Application < Rails::Application | ||
config.root = File.expand_path("..", __FILE__).freeze | ||
config.eager_load = false | ||
|
||
# Show full error reports and disable caching. | ||
config.consider_all_requests_local = true | ||
config.action_controller.perform_caching = false | ||
|
||
# Raise exceptions instead of rendering exception templates. | ||
config.action_dispatch.show_exceptions = false | ||
|
||
# Randomize the order test cases are executed. | ||
config.active_support.test_order = :random | ||
|
||
# Print deprecation notices to the stderr. | ||
config.active_support.deprecation = :stderr | ||
|
||
config.assets.enabled = true | ||
config.assets.debug = true | ||
config.assets.digest = true | ||
config.assets.raise_runtime_errors = true | ||
config.assets.version = "1.0" | ||
|
||
config.secret_token = "SECRET_TOKEN_IS_MIN_30_CHARS_LONG" | ||
config.secret_key_base = "SECRET_KEY_BASE" | ||
|
||
def require_environment! | ||
initialize! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
EmberCLI.configure do |c| | ||
c.app "my-app" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.routes.draw do | ||
root to: "application#index" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
feature "User views ember app", :js do | ||
scenario "from root" do | ||
visit root_path | ||
|
||
expect(page).to have_text "Welcome to Ember" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ENV["RAILS_ENV"] = "test" | ||
|
||
require "dummy/application" | ||
|
||
require "rspec/rails" | ||
|
||
Dummy::Application.initialize! | ||
|
||
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |file| require file } | ||
|
||
RSpec.configure do |config| | ||
config.expect_with :rspec do |expectations| | ||
expectations.syntax = :expect | ||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true | ||
end | ||
|
||
config.mock_with :rspec do |mocks| | ||
mocks.syntax = :expect | ||
mocks.verify_partial_doubles = true | ||
end | ||
|
||
config.infer_spec_type_from_file_location! | ||
config.order = :random | ||
end | ||
|
||
Capybara::Webkit.configure do |config| | ||
config.block_unknown_urls = true | ||
end | ||
|
||
Capybara.javascript_driver = :webkit |