Permalink
Browse files

test errors for pending migrations

App should raise error on page_load
  • Loading branch information...
1 parent 96f19f6 commit d741a4c6f863778c5ebf04b21f6c3292091c13a7 @schneems schneems committed Jun 6, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 railties/test/application/configuration_test.rb
@@ -41,6 +41,21 @@ def teardown
FileUtils.rm_rf(new_app) if File.directory?(new_app)
end
+ test "a renders exception on pending migration" do
+ add_to_config <<-RUBY
+ config.active_record.migration_error = :page_load
+ config.consider_all_requests_local = true
+ config.action_dispatch.show_exceptions = true
+ RUBY
+
+ require "#{app_path}/config/environment"
+ ActiveRecord::Migrator.stubs(:needs_migrations?).returns(true)
+
+ get "/foo"
+ assert_equal 500, last_response.status
+ assert_match "ActiveRecord::PendingMigrationError", last_response.body
+ end
+
test "multiple queue construction is possible" do
require 'rails'
require "#{app_path}/config/environment"

0 comments on commit d741a4c

Please sign in to comment.