Skip to content

Commit

Permalink
test errors for pending migrations
Browse files Browse the repository at this point in the history
App should raise error on page_load
  • Loading branch information
schneems committed Jun 9, 2012
1 parent 96f19f6 commit d741a4c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions railties/test/application/configuration_test.rb
Expand Up @@ -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"
Expand Down

0 comments on commit d741a4c

Please sign in to comment.