Rails 2.1.1
Among other things, a security fix.
This commit is contained in:
parent
d2c4c8737c
commit
d4f97345db
354 changed files with 21027 additions and 3072 deletions
|
@ -68,6 +68,11 @@ class NewRenderTestController < ActionController::Base
|
|||
path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb')
|
||||
render :file => path
|
||||
end
|
||||
|
||||
def render_file_from_template
|
||||
@secret = 'in the sauce'
|
||||
@path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb'))
|
||||
end
|
||||
|
||||
def render_file_with_locals
|
||||
path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.erb')
|
||||
|
@ -259,6 +264,10 @@ class NewRenderTestController < ActionController::Base
|
|||
render :template => "test/hello_world"
|
||||
end
|
||||
|
||||
def render_with_explicit_template_with_locals
|
||||
render :template => "test/render_file_with_locals", :locals => { :secret => 'area51' }
|
||||
end
|
||||
|
||||
def double_render
|
||||
render :text => "hello"
|
||||
render :text => "world"
|
||||
|
@ -531,6 +540,11 @@ class NewRenderTest < Test::Unit::TestCase
|
|||
get :render_file_with_locals
|
||||
assert_equal "The secret is in the sauce\n", @response.body
|
||||
end
|
||||
|
||||
def test_render_file_from_template
|
||||
get :render_file_from_template
|
||||
assert_equal "The secret is in the sauce\n", @response.body
|
||||
end
|
||||
|
||||
def test_attempt_to_access_object_method
|
||||
assert_raises(ActionController::UnknownAction, "No action responded to [clone]") { get :clone }
|
||||
|
@ -742,7 +756,7 @@ EOS
|
|||
|
||||
def test_partial_collection_with_counter
|
||||
get :partial_collection_with_counter
|
||||
assert_equal "david1mary2", @response.body
|
||||
assert_equal "david0mary1", @response.body
|
||||
end
|
||||
|
||||
def test_partial_collection_with_locals
|
||||
|
@ -762,7 +776,7 @@ EOS
|
|||
|
||||
def test_partial_collection_shorthand_with_different_types_of_records
|
||||
get :partial_collection_shorthand_with_different_types_of_records
|
||||
assert_equal "Bonjour bad customer: mark1Bonjour good customer: craig2Bonjour bad customer: john3Bonjour good customer: zach4Bonjour good customer: brandon5Bonjour bad customer: dan6", @response.body
|
||||
assert_equal "Bonjour bad customer: mark0Bonjour good customer: craig1Bonjour bad customer: john2Bonjour good customer: zach3Bonjour good customer: brandon4Bonjour bad customer: dan5", @response.body
|
||||
end
|
||||
|
||||
def test_empty_partial_collection
|
||||
|
@ -800,7 +814,12 @@ EOS
|
|||
get :render_text_with_assigns
|
||||
assert_equal "world", assigns["hello"]
|
||||
end
|
||||
|
||||
|
||||
def test_template_with_locals
|
||||
get :render_with_explicit_template_with_locals
|
||||
assert_equal "The secret is area51\n", @response.body
|
||||
end
|
||||
|
||||
def test_update_page
|
||||
get :update_page
|
||||
assert_template nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue