Skip to content

Commit

Permalink
DEV: Automatically maintain test database schema
Browse files Browse the repository at this point in the history
  • Loading branch information
xrav3nz committed May 8, 2020
1 parent 609e929 commit 90ac78a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/rails_helper.rb
Expand Up @@ -178,9 +178,10 @@ def fab!(name, &blk)

config.before(:suite) do
begin
ActiveRecord::Migration.check_pending!
rescue ActiveRecord::PendingMigrationError
raise "There are pending migrations, run RAILS_ENV=test bin/rake db:migrate"
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end

Sidekiq.error_handlers.clear
Expand Down

0 comments on commit 90ac78a

Please sign in to comment.