]> git.openstreetmap.org Git - rails.git/blob - test/functional/old_way_controller_test.rb
some useful notes in code for ideas that require implementing.
[rails.git] / test / functional / old_way_controller_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'old_way_controller'
3
4 # Re-raise errors caught by the controller.
5 class OldWayController; def rescue_action(e) raise e end; end
6
7 class OldWayControllerTest < Test::Unit::TestCase
8   api_fixtures
9
10   def setup
11     @controller = OldWayController.new
12     @request    = ActionController::TestRequest.new
13     @response   = ActionController::TestResponse.new
14   end
15
16   # -------------------------------------
17   # Test reading old ways.
18   # -------------------------------------
19
20   def test_history_visible
21     # check that a visible way is returned properly
22     get :history, :id => ways(:visible_way).id
23     assert_response :success
24   end
25   
26   def test_history_invisible
27     # check chat a non-existent way is not returned
28     get :history, :id => 0
29     assert_response :not_found
30
31   end
32
33 end