X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/71654e563ebe04856b931a7ad62a2f4bf2a04c65..93a9f31bf0e1cd3d5aec478aeef65c8132b02bdd:/test/controllers/api/user_blocks_controller_test.rb diff --git a/test/controllers/api/user_blocks_controller_test.rb b/test/controllers/api/user_blocks_controller_test.rb index eef54e931..c8bdc1d57 100644 --- a/test/controllers/api/user_blocks_controller_test.rb +++ b/test/controllers/api/user_blocks_controller_test.rb @@ -7,6 +7,10 @@ module Api { :path => "/api/0.6/user_blocks/1", :method => :get }, { :controller => "api/user_blocks", :action => "show", :id => "1" } ) + assert_routing( + { :path => "/api/0.6/user_blocks/1.json", :method => :get }, + { :controller => "api/user_blocks", :action => "show", :id => "1", :format => "json" } + ) end def test_show @@ -15,6 +19,12 @@ module Api get api_user_block_path(:id => block) assert_response :success assert_select "user_block[id='#{block.id}']", 1 + + get api_user_block_path(:id => block, :format => "json") + assert_response :success + js = ActiveSupport::JSON.decode(@response.body) + assert_not_nil js + assert_equal block.id, js["user_block"]["id"] end def test_show_not_found