X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/5449cf4adcc1fad4b9f43426e6d3e4a8f65e6fbb..90e46a58de583ac2bd7bb43077faa94186957a7a:/test/functional/old_relation_controller_test.rb diff --git a/test/functional/old_relation_controller_test.rb b/test/functional/old_relation_controller_test.rb index a52211e2e..89676a175 100644 --- a/test/functional/old_relation_controller_test.rb +++ b/test/functional/old_relation_controller_test.rb @@ -4,18 +4,29 @@ require 'old_relation_controller' class OldRelationControllerTest < ActionController::TestCase api_fixtures + ## + # test all routes which lead to this controller + def test_routes + assert_routing( + { :path => "/api/0.6/relation/1/history", :method => :get }, + { :controller => "old_relation", :action => "history", :id => "1" } + ) + assert_routing( + { :path => "/api/0.6/relation/1/2", :method => :get }, + { :controller => "old_relation", :action => "version", :id => "1", :version => "2" } + ) + end + # ------------------------------------- # Test reading old relations. # ------------------------------------- def test_history # check that a visible relations is returned properly - get :history, :id => relations(:visible_relation).id + get :history, :id => relations(:visible_relation).relation_id assert_response :success # check chat a non-existent relations is not returned get :history, :id => 0 assert_response :not_found - end - end