From bd96e45641df33d91ebc7b1dbb1589b376c6ef24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 15 Nov 2010 23:59:18 +0100 Subject: Fix failing tests. --- railties/test/railties/engine_test.rb | 36 +++++++---------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) (limited to 'railties') diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 822be24ef1..701b6816c8 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -224,32 +224,14 @@ module RailtiesTest end RUBY - @plugin.write "app/views/foo/index.html.erb", <<-RUBY - <%= compute_public_path("/foo", "") %> + @plugin.write "app/views/foo/index.html.erb", <<-ERB <%= image_path("foo.png") %> <%= javascript_include_tag("foo") %> <%= stylesheet_link_tag("foo") %> - RUBY - - - app_file "app/controllers/bar_controller.rb", <<-RUBY - class BarController < ActionController::Base - def index - render :index - end - end - RUBY - - app_file "app/views/bar/index.html.erb", <<-RUBY - <%= compute_public_path("/foo", "") %> - RUBY + ERB add_to_config 'config.asset_path = "/omg%s"' - @plugin.write 'public/touch.txt', <<-RUBY - touch - RUBY - boot_rails # should set asset_path with engine name by default @@ -259,11 +241,10 @@ module RailtiesTest env = Rack::MockRequest.env_for("/foo") response = Bukkits::Engine.call(env) - stripped_body = response[2].body.split("\n").map(&:strip).join("\n") + stripped_body = response[2].body.split("\n").map(&:strip).join - expected = "/omg/bukkits/foo\n" + - "/omg/bukkits/images/foo.png\n" + - "\n" + + expected = "/omg/bukkits/images/foo.png" + + "" + "" assert_equal expected, stripped_body end @@ -278,21 +259,18 @@ module RailtiesTest @plugin.write "app/controllers/foo_controller.rb", <<-RUBY class FooController < ActionController::Base def index + render :inline => '<%= image_path("foo.png") %>' end end RUBY - @plugin.write "app/views/foo/index.html.erb", <<-RUBY - <%= compute_public_path("/foo", "") %> - RUBY - boot_rails env = Rack::MockRequest.env_for("/foo") response = Bukkits::Engine.call(env) stripped_body = response[2].body.strip - expected = "/bukkits/foo" + expected = "/bukkits/images/foo.png" assert_equal expected, stripped_body end -- cgit v1.2.3