1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Currectly test the Middleware#==

This commit is contained in:
Rafael Mendonça França 2015-12-22 17:09:26 -02:00
parent d9f4a2839f
commit d182c22e91

View file

@ -133,14 +133,18 @@ class MiddlewareStackTest < ActiveSupport::TestCase
end
test "can check if Middleware are equal - Class" do
assert_equal BazMiddleware, BazMiddleware
assert_equal @stack.last, BarMiddleware
end
test "includes a class" do
assert_equal true, @stack.include?(BarMiddleware)
end
test "can check if Middleware are equal - Middleware" do
assert_equal @stack.middlewares.first, @stack.middlewares.first
assert_equal @stack.last, @stack.last
end
test "klass is correct" do
assert_equal @stack.middlewares.first.klass, FooMiddleware
test "includes a middleware" do
assert_equal true, @stack.include?(ActionDispatch::MiddlewareStack::Middleware.new(BarMiddleware, nil, nil))
end
end