Skip to content

Commit 8cbf301

Browse files
chancancodeeileencodes
authored andcommitted
Fix actionpack test cases broken by rails#16888
1 parent f5f7ecc commit 8cbf301

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

actionpack/test/controller/new_base/render_file_test.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ def with_instance_variables
1313
render :file => File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar')
1414
end
1515

16-
def without_file_key
17-
render File.join(File.dirname(__FILE__), *%w[.. .. fixtures test hello_world])
18-
end
19-
20-
def without_file_key_with_instance_variable
21-
@secret = 'in the sauce'
22-
render File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar')
23-
end
24-
2516
def relative_path
2617
@secret = 'in the sauce'
2718
render :file => '../../fixtures/test/render_file_with_ivar'
@@ -41,11 +32,6 @@ def with_locals
4132
path = File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_locals')
4233
render :file => path, :locals => {:secret => 'in the sauce'}
4334
end
44-
45-
def without_file_key_with_locals
46-
path = FIXTURES.join('test/render_file_with_locals').to_s
47-
render path, :locals => {:secret => 'in the sauce'}
48-
end
4935
end
5036

5137
class TestBasic < Rack::TestCase
@@ -61,16 +47,6 @@ class TestBasic < Rack::TestCase
6147
assert_response "The secret is in the sauce\n"
6248
end
6349

64-
test "rendering path without specifying the :file key" do
65-
get :without_file_key
66-
assert_response "Hello world!"
67-
end
68-
69-
test "rendering path without specifying the :file key with ivar" do
70-
get :without_file_key_with_instance_variable
71-
assert_response "The secret is in the sauce\n"
72-
end
73-
7450
test "rendering a relative path" do
7551
get :relative_path
7652
assert_response "The secret is in the sauce\n"
@@ -90,10 +66,5 @@ class TestBasic < Rack::TestCase
9066
get :with_locals
9167
assert_response "The secret is in the sauce\n"
9268
end
93-
94-
test "rendering path without specifying the :file key with locals" do
95-
get :without_file_key_with_locals
96-
assert_response "The secret is in the sauce\n"
97-
end
9869
end
9970
end

actionpack/test/controller/new_base/render_template_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def with_locals
4545
render :template => "locals", :locals => { :secret => 'area51' }
4646
end
4747

48+
def with_locals_without_key
49+
render "locals", :locals => { :secret => 'area51' }
50+
end
51+
4852
def builder_template
4953
render :template => "xml_template"
5054
end
@@ -101,6 +105,11 @@ class TestWithoutLayout < Rack::TestCase
101105
assert_response "The secret is area51"
102106
end
103107

108+
test "rendering a template with local variables without key" do
109+
get :with_locals
110+
assert_response "The secret is area51"
111+
end
112+
104113
test "rendering a builder template" do
105114
get :builder_template, "format" => "xml"
106115
assert_response "<html>\n <p>Hello</p>\n</html>\n"

0 commit comments

Comments
 (0)