Added CheckPending middleware in default

As this middleware comes by default in a new
rails app

Added test to check omit for CheckPending when

Active Record is not included.
This commit is contained in:
Arun Agrawal 2013-07-15 10:47:59 +02:00
parent b5f8630591
commit 3b03733d9e
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,8 @@ module ApplicationTests
end end
test "default middleware stack" do test "default middleware stack" do
add_to_config "config.active_record.migration_error = :page_load"
boot! boot!
assert_equal [ assert_equal [
@ -35,6 +37,7 @@ module ApplicationTests
"ActionDispatch::RemoteIp", "ActionDispatch::RemoteIp",
"ActionDispatch::Reloader", "ActionDispatch::Reloader",
"ActionDispatch::Callbacks", "ActionDispatch::Callbacks",
"ActiveRecord::Migration::CheckPending",
"ActiveRecord::ConnectionAdapters::ConnectionManagement", "ActiveRecord::ConnectionAdapters::ConnectionManagement",
"ActiveRecord::QueryCache", "ActiveRecord::QueryCache",
"ActionDispatch::Cookies", "ActionDispatch::Cookies",
@ -88,6 +91,7 @@ module ApplicationTests
boot! boot!
assert !middleware.include?("ActiveRecord::ConnectionAdapters::ConnectionManagement") assert !middleware.include?("ActiveRecord::ConnectionAdapters::ConnectionManagement")
assert !middleware.include?("ActiveRecord::QueryCache") assert !middleware.include?("ActiveRecord::QueryCache")
assert !middleware.include?("ActiveRecord::Migration::CheckPending")
end end
test "removes lock if cache classes is set" do test "removes lock if cache classes is set" do