Rails 2.3.3.1
Update to latest Rails. A little bit of jiggery-pokery is involved, since they neglected to re-include vendored Rack in this release.
This commit is contained in:
parent
329fafafce
commit
664552ac02
257 changed files with 4346 additions and 1682 deletions
|
@ -193,20 +193,24 @@ class TestController < ActionController::Base
|
|||
render :inline => "<%= controller_name %>"
|
||||
end
|
||||
|
||||
def render_json_nil
|
||||
render :json => nil
|
||||
end
|
||||
|
||||
def render_json_hello_world
|
||||
render :json => {:hello => 'world'}.to_json
|
||||
render :json => ActiveSupport::JSON.encode(:hello => 'world')
|
||||
end
|
||||
|
||||
def render_json_hello_world_with_callback
|
||||
render :json => {:hello => 'world'}.to_json, :callback => 'alert'
|
||||
render :json => ActiveSupport::JSON.encode(:hello => 'world'), :callback => 'alert'
|
||||
end
|
||||
|
||||
def render_json_with_custom_content_type
|
||||
render :json => {:hello => 'world'}.to_json, :content_type => 'text/javascript'
|
||||
render :json => ActiveSupport::JSON.encode(:hello => 'world'), :content_type => 'text/javascript'
|
||||
end
|
||||
|
||||
def render_symbol_json
|
||||
render :json => {:hello => 'world'}.to_json
|
||||
render :json => ActiveSupport::JSON.encode(:hello => 'world')
|
||||
end
|
||||
|
||||
def render_json_with_render_to_string
|
||||
|
@ -886,33 +890,39 @@ class RenderTest < ActionController::TestCase
|
|||
assert_equal "The secret is in the sauce\n", @response.body
|
||||
end
|
||||
|
||||
def test_render_json_nil
|
||||
get :render_json_nil
|
||||
assert_equal 'null', @response.body
|
||||
assert_equal 'application/json', @response.content_type
|
||||
end
|
||||
|
||||
def test_render_json
|
||||
get :render_json_hello_world
|
||||
assert_equal '{"hello": "world"}', @response.body
|
||||
assert_equal '{"hello":"world"}', @response.body
|
||||
assert_equal 'application/json', @response.content_type
|
||||
end
|
||||
|
||||
def test_render_json_with_callback
|
||||
get :render_json_hello_world_with_callback
|
||||
assert_equal 'alert({"hello": "world"})', @response.body
|
||||
assert_equal 'alert({"hello":"world"})', @response.body
|
||||
assert_equal 'application/json', @response.content_type
|
||||
end
|
||||
|
||||
def test_render_json_with_custom_content_type
|
||||
get :render_json_with_custom_content_type
|
||||
assert_equal '{"hello": "world"}', @response.body
|
||||
assert_equal '{"hello":"world"}', @response.body
|
||||
assert_equal 'text/javascript', @response.content_type
|
||||
end
|
||||
|
||||
def test_render_symbol_json
|
||||
get :render_symbol_json
|
||||
assert_equal '{"hello": "world"}', @response.body
|
||||
assert_equal '{"hello":"world"}', @response.body
|
||||
assert_equal 'application/json', @response.content_type
|
||||
end
|
||||
|
||||
def test_render_json_with_render_to_string
|
||||
get :render_json_with_render_to_string
|
||||
assert_equal '{"hello": "partial html"}', @response.body
|
||||
assert_equal '{"hello":"partial html"}', @response.body
|
||||
assert_equal 'application/json', @response.content_type
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue