Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8762: actionpack_test_patch_8762.diff

File actionpack_test_patch_8762.diff, 1.0 kB (added by choonkeat, 9 months ago)

Patch for ActionPack test to validate against quoted json keys

  • actionpack/test/controller/render_test.rb

    old new  
    209209 
    210210  def test_do_with_render_json 
    211211    get :render_json_hello_world 
    212     assert_equal '{hello: "world"}', @response.body 
     212    assert_equal '{"hello": "world"}', @response.body 
    213213    assert_equal 'application/json', @response.content_type 
    214214  end 
    215215 
    216216  def test_do_with_render_json_with_callback 
    217217    get :render_json_hello_world_with_callback 
    218     assert_equal 'alert({hello: "world"})', @response.body 
     218    assert_equal 'alert({"hello": "world"})', @response.body 
    219219    assert_equal 'application/json', @response.content_type 
    220220  end 
    221221 
    222222  def test_do_with_render_symbol_json 
    223223    get :render_symbol_json 
    224     assert_equal '{hello: "world"}', @response.body 
     224    assert_equal '{"hello": "world"}', @response.body 
    225225    assert_equal 'application/json', @response.content_type 
    226226  end 
    227227