X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/71654e563ebe04856b931a7ad62a2f4bf2a04c65..cee9818dfc9ac3f6eae01cdb51df9093ae5d1322:/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