Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test errors for pending migrations

App should raise error on page_load
  • Loading branch information...
commit d741a4c6f863778c5ebf04b21f6c3292091c13a7 1 parent 96f19f6
Richard Schneeman schneems authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 railties/test/application/configuration_test.rb
15 railties/test/application/configuration_test.rb
View
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.