提交 391cfc20 编写于 作者: G Godfrey Chan

Fix actionpack test cases broken by #16888

上级 b5571b3c
......@@ -13,15 +13,6 @@ def with_instance_variables
render :file => File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar')
end
def without_file_key
render File.join(File.dirname(__FILE__), *%w[.. .. fixtures test hello_world])
end
def without_file_key_with_instance_variable
@secret = 'in the sauce'
render File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar')
end
def relative_path
@secret = 'in the sauce'
render :file => '../../fixtures/test/render_file_with_ivar'
......@@ -41,11 +32,6 @@ def with_locals
path = File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_locals')
render :file => path, :locals => {:secret => 'in the sauce'}
end
def without_file_key_with_locals
path = FIXTURES.join('test/render_file_with_locals').to_s
render path, :locals => {:secret => 'in the sauce'}
end
end
class TestBasic < Rack::TestCase
......@@ -61,16 +47,6 @@ class TestBasic < Rack::TestCase
assert_response "The secret is in the sauce\n"
end
test "rendering path without specifying the :file key" do
get :without_file_key
assert_response "Hello world!"
end
test "rendering path without specifying the :file key with ivar" do
get :without_file_key_with_instance_variable
assert_response "The secret is in the sauce\n"
end
test "rendering a relative path" do
get :relative_path
assert_response "The secret is in the sauce\n"
......@@ -90,10 +66,5 @@ class TestBasic < Rack::TestCase
get :with_locals
assert_response "The secret is in the sauce\n"
end
test "rendering path without specifying the :file key with locals" do
get :without_file_key_with_locals
assert_response "The secret is in the sauce\n"
end
end
end
......@@ -45,6 +45,10 @@ def with_locals
render :template => "locals", :locals => { :secret => 'area51' }
end
def with_locals_without_key
render "locals", :locals => { :secret => 'area51' }
end
def builder_template
render :template => "xml_template"
end
......@@ -101,6 +105,11 @@ class TestWithoutLayout < Rack::TestCase
assert_response "The secret is area51"
end
test "rendering a template with local variables without key" do
get :with_locals
assert_response "The secret is area51"
end
test "rendering a builder template" do
get :builder_template, "format" => "xml"
assert_response "<html>\n <p>Hello</p>\n</html>\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册