Permalink
Browse files

Fix tests in railties

  • Loading branch information...
1 parent 4eb0d58 commit d9b732fcadc001b6757e648761acf97833827b58 @drogus drogus committed Dec 18, 2010
Showing with 13 additions and 13 deletions.
  1. +10 −10 railties/test/railties/engine_test.rb
  2. +3 −3 railties/test/railties/railtie_test.rb
@@ -90,7 +90,7 @@ class Engine < ::Rails::Engine
env = Rack::MockRequest.env_for("/bukkits")
response = Rails.application.call(env)
- assert_equal ["HELLO WORLD"], response[2]
+ assert_equal rack_body(["HELLO WORLD"]), rack_body(response[2])
end
test "it provides routes as default endpoint" do
@@ -117,7 +117,7 @@ class Engine < ::Rails::Engine
env = Rack::MockRequest.env_for("/bukkits/foo")
response = Rails.application.call(env)
- assert_equal ["foo"], response[2]
+ assert_equal rack_body(["foo"]), rack_body(response[2])
end
test "engine can load its own plugins" do
@@ -357,15 +357,15 @@ def bar
env = Rack::MockRequest.env_for("/foo")
response = Rails.application.call(env)
- assert_equal ["Something... Something... Something..."], response[2]
+ assert_equal rack_body(["Something... Something... Something..."]), rack_body(response[2])
env = Rack::MockRequest.env_for("/foo/show")
response = Rails.application.call(env)
- assert_equal ["/foo"], response[2]
+ assert_equal rack_body(["/foo"]), rack_body(response[2])
env = Rack::MockRequest.env_for("/foo/bar")
response = Rails.application.call(env)
- assert_equal ["It's a bar."], response[2]
+ assert_equal rack_body(["It's a bar."]), rack_body(response[2])
end
test "isolated engine should include only its own routes and helpers" do
@@ -466,23 +466,23 @@ class MyMailer < ActionMailer::Base
env = Rack::MockRequest.env_for("/bukkits/from_app")
response = AppTemplate::Application.call(env)
- assert_equal ["false"], response[2]
+ assert_equal rack_body(["false"]), rack_body(response[2])
env = Rack::MockRequest.env_for("/bukkits/foo/show")
response = AppTemplate::Application.call(env)
- assert_equal ["/bukkits/foo"], response[2]
+ assert_equal rack_body(["/bukkits/foo"]), rack_body(response[2])
env = Rack::MockRequest.env_for("/bukkits/foo")
response = AppTemplate::Application.call(env)
- assert_equal ["Helped."], response[2]
+ assert_equal rack_body(["Helped."]), rack_body(response[2])
env = Rack::MockRequest.env_for("/bukkits/routes_helpers_in_view")
response = AppTemplate::Application.call(env)
- assert_equal ["/bukkits/foo, /bar"], response[2]
+ assert_equal rack_body(["/bukkits/foo, /bar"]), rack_body(response[2])
env = Rack::MockRequest.env_for("/bukkits/polymorphic_path_without_namespace")
response = AppTemplate::Application.call(env)
- assert_equal ["/bukkits/posts/1"], response[2]
+ assert_equal rack_body(["/bukkits/posts/1"]), rack_body(response[2])
end
test "isolated engine should avoid namespace in names if that's possible" do
@@ -21,10 +21,10 @@ def app
test "Railtie provides railtie_name" do
begin
- class ::Foo < Rails::Railtie ; end
- assert_equal "foo", ::Foo.railtie_name
+ class ::FooBarBaz < Rails::Railtie ; end
+ assert_equal "foo_bar_baz", ::FooBarBaz.railtie_name
ensure
- Object.send(:remove_const, :"Foo")
+ Object.send(:remove_const, :"FooBarBaz")
end
end

0 comments on commit d9b732f

Please sign in to comment.