X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6339473cb77e4e0998b959a0835a8f42767f608d..21855aa355ed66bea0ae21acb3d675aeaccc963b:/test/functional/old_way_controller_test.rb diff --git a/test/functional/old_way_controller_test.rb b/test/functional/old_way_controller_test.rb index c47b45dfc..f0ab6bd85 100644 --- a/test/functional/old_way_controller_test.rb +++ b/test/functional/old_way_controller_test.rb @@ -1,16 +1,20 @@ require File.dirname(__FILE__) + '/../test_helper' require 'old_way_controller' -# Re-raise errors caught by the controller. -class OldWayController; def rescue_action(e) raise e end; end - -class OldWayControllerTest < Test::Unit::TestCase +class OldWayControllerTest < ActionController::TestCase api_fixtures - def setup - @controller = OldWayController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new + ## + # test all routes which lead to this controller + def test_routes + assert_routing( + { :path => "/api/0.6/way/1/history", :method => :get }, + { :controller => "old_way", :action => "history", :id => "1" } + ) + assert_routing( + { :path => "/api/0.6/way/1/2", :method => :get }, + { :controller => "old_way", :action => "version", :id => "1", :version => "2" } + ) end # ------------------------------------- @@ -19,13 +23,13 @@ class OldWayControllerTest < Test::Unit::TestCase def test_history_visible # check that a visible way is returned properly - get :history, :id => ways(:visible_way).id + get :history, :id => ways(:visible_way).way_id assert_response :success end def test_history_invisible # check that an invisible way's history is returned properly - get :history, :id => ways(:invisible_way).id + get :history, :id => ways(:invisible_way).way_id assert_response :success end