]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/old_way_controller_test.rb
- add old_relation_controller and stuff so that relation history works. fixes #557.
[rails.git] / 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
new file mode 100644 (file)
index 0000000..374ea7d
--- /dev/null
@@ -0,0 +1,31 @@
+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
+  api_fixtures
+
+  def setup
+    @controller = OldWayController.new
+    @request    = ActionController::TestRequest.new
+    @response   = ActionController::TestResponse.new
+  end
+
+  # -------------------------------------
+  # Test reading old ways.
+  # -------------------------------------
+
+  def test_history
+    # check that a visible way is returned properly
+    get :history, :id => ways(:visible_way).id
+    assert_response :success
+
+    # check chat a non-existent way is not returned
+    get :history, :id => 0
+    assert_response :not_found
+
+  end
+
+end