Skip to content

Commit

Permalink
Fix test suite issues
Browse files Browse the repository at this point in the history
* Intermittent failures were caused because one acceptance spec was not
cleaning up after itself.
* Some developers were seeing test suite failures under Rails 5 because
`rake db:environment:set` needed to be run. This task doesn't exist in
earlier versions of Rails, so we created a dummy task in the dummy app
so we could call it nonetheless.
* Edge rails appraisal doesn't need edge rspec
  • Loading branch information
derekprior committed Jan 15, 2017
1 parent 13709f4 commit fc7eee0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
7 changes: 1 addition & 6 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ if RUBY_VERSION > "2.2.0"

appraise "rails-edge" do
gem "rails", github: "rails/rails"
gem "rspec-rails", github: "rspec/rspec-rails"
gem "rspec-support", github: "rspec/rspec-support"
gem "rspec-core", github: "rspec/rspec-core"
gem "rspec-mocks", github: "rspec/rspec-mocks"
gem "rspec-expectations", github: "rspec/rspec-expectations"
gem "rspec", github: "rspec/rspec"
gem "arel", github: "rails/arel"
end
end
1 change: 1 addition & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ if [ -z "$CI" ]; then
bundle exec appraisal install
fi

bundle exec rake dummy:db:drop
bundle exec rake dummy:db:create
7 changes: 1 addition & 6 deletions gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
source "https://rubygems.org"

gem "rails", :github => "rails/rails"
gem "rspec-rails", :github => "rspec/rspec-rails"
gem "rspec-support", :github => "rspec/rspec-support"
gem "rspec-core", :github => "rspec/rspec-core"
gem "rspec-mocks", :github => "rspec/rspec-mocks"
gem "rspec-expectations", :github => "rspec/rspec-expectations"
gem "rspec", :github => "rspec/rspec"
gem "arel", :github => "rails/arel"

gemspec :path => "../"
1 change: 1 addition & 0 deletions spec/acceptance/user_manages_views_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

it "handles plural view names gracefully during generation" do
successfully "rails generate scenic:model search_results --materialized"
successfully "rails destroy scenic:model search_results --materialized"
end

def successfully(command)
Expand Down
3 changes: 2 additions & 1 deletion spec/acceptance_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
config.after(:suite) do
Dir.chdir("spec/dummy") do
system <<-CMD
rake db:drop db:create &&
echo &&
rake db:environment:set db:drop db:create &&
git add -A &&
git reset --hard HEAD 1>/dev/null &&
rm -rf .git/ 1>/dev/null
Expand Down
7 changes: 7 additions & 0 deletions spec/dummy/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks

unless Rake::Task.task_defined?('db:environment:set')
desc 'dummy task for rails versions where this task does not exist'
task 'db:environment:set' do
#no op
end
end

0 comments on commit fc7eee0

Please sign in to comment.