Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix actionpack test cases broken by #16888
  • Loading branch information
chancancode committed Sep 25, 2014
1 parent b5571b3 commit 391cfc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 29 deletions.
29 changes: 0 additions & 29 deletions actionpack/test/controller/new_base/render_file_test.rb
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
9 changes: 9 additions & 0 deletions actionpack/test/controller/new_base/render_template_test.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 391cfc2

Please sign in to comment.