diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-12-18 21:47:27 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-12-18 21:47:27 +0100 |
commit | d9b732fcadc001b6757e648761acf97833827b58 (patch) | |
tree | c2ba5c15ef04147f80306b241074d93f7b948f47 /railties/test | |
parent | 4eb0d580a2b0d11f7285bca1665e0d42b3266f15 (diff) | |
download | rails-d9b732fcadc001b6757e648761acf97833827b58.tar.gz rails-d9b732fcadc001b6757e648761acf97833827b58.tar.bz2 rails-d9b732fcadc001b6757e648761acf97833827b58.zip |
Fix tests in railties
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 20 | ||||
-rw-r--r-- | railties/test/railties/railtie_test.rb | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 6b64a19741..388f940f81 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -90,7 +90,7 @@ module RailtiesTest 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 @@ module RailtiesTest 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 @@ module RailtiesTest 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 @@ module RailtiesTest 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 diff --git a/railties/test/railties/railtie_test.rb b/railties/test/railties/railtie_test.rb index 6d194eecba..7ea8364ae9 100644 --- a/railties/test/railties/railtie_test.rb +++ b/railties/test/railties/railtie_test.rb @@ -21,10 +21,10 @@ module RailtiesTest 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 |