Skip to content
Browse files

Don't expect an AD::Response object back from the app.

  • Loading branch information...
1 parent 4a4ff14 commit 68d75c3365e1d0e1af21caab01e192223c371511 @josevalim josevalim committed
Showing with 10 additions and 11 deletions.
  1. +10 −11 railties/test/railties/engine_test.rb
View
21 railties/test/railties/engine_test.rb
@@ -89,7 +89,7 @@ class Engine < ::Rails::Engine
env = Rack::MockRequest.env_for("/bukkits")
response = Rails.application.call(env)
- assert_equal "HELLO WORLD", response[2]
+ assert_equal ["HELLO WORLD"], response[2]
end
test "it provides routes as default endpoint" do
@@ -116,8 +116,7 @@ class Engine < ::Rails::Engine
env = Rack::MockRequest.env_for("/bukkits/foo")
response = Rails.application.call(env)
-
- assert_equal "foo", response[2]
+ assert_equal ["foo"], response[2]
end
test "engine can load its own plugins" do
@@ -379,15 +378,15 @@ def bar
env = Rack::MockRequest.env_for("/foo")
response = Rails.application.call(env)
- assert_equal "Something... Something... Something...", response[2].body
+ assert_equal ["Something... Something... Something..."], response[2]
env = Rack::MockRequest.env_for("/foo/show")
response = Rails.application.call(env)
- assert_equal "/foo", response[2].body
+ assert_equal ["/foo"], response[2]
env = Rack::MockRequest.env_for("/foo/bar")
response = Rails.application.call(env)
- assert_equal "It's a bar.", response[2].body
+ assert_equal ["It's a bar."], response[2]
end
test "isolated engine should include only its own routes and helpers" do
@@ -488,23 +487,23 @@ class MyMailer < ActionMailer::Base
env = Rack::MockRequest.env_for("/bukkits/from_app")
response = AppTemplate::Application.call(env)
- assert_equal "false", response[2].body
+ assert_equal ["false"], response[2]
env = Rack::MockRequest.env_for("/bukkits/foo/show")
response = AppTemplate::Application.call(env)
- assert_equal "/bukkits/foo", response[2].body
+ assert_equal ["/bukkits/foo"], response[2]
env = Rack::MockRequest.env_for("/bukkits/foo")
response = AppTemplate::Application.call(env)
- assert_equal "Helped.", response[2].body
+ assert_equal ["Helped."], response[2]
env = Rack::MockRequest.env_for("/bukkits/routes_helpers_in_view")
response = AppTemplate::Application.call(env)
- assert_equal "/bukkits/foo, /bar", response[2].body
+ assert_equal ["/bukkits/foo, /bar"], response[2]
env = Rack::MockRequest.env_for("/bukkits/polymorphic_path_without_namespace")
response = AppTemplate::Application.call(env)
- assert_equal "/bukkits/posts/1", response[2].body
+ assert_equal ["/bukkits/posts/1"], response[2]
end
test "isolated engine should avoid namespace in names if that's possible" do

0 comments on commit 68d75c3

Please sign in to comment.
Something went wrong with that request. Please try again.