require File.dirname(__FILE__) + '/../test_helper'
require 'api_controller'
-# Re-raise errors caught by the controller.
-class ApiController; def rescue_action(e) raise e end; end
-
-class ApiControllerTest < Test::Unit::TestCase
+class ApiControllerTest < ActionController::TestCase
api_fixtures
def setup
- @controller = ApiController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
+ super
@badbigbbox = %w{ -0.1,-0.1,1.1,1.1 10,10,11,11 }
@badmalformedbbox = %w{ -0.1 hello
10N2W10.1N2.1W }
require File.dirname(__FILE__) + '/../test_helper'
require 'browse_controller'
-# Re-raise errors caught by the controller.
-class BrowseController; def rescue_action(e) raise e end; end
-
- class BrowseControllerTest < Test::Unit::TestCase
+class BrowseControllerTest < ActionController::TestCase
api_fixtures
-
-
-
- def setup
- @controller = BrowseController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
def basic_authorization(user, pass)
@request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
require File.dirname(__FILE__) + '/../test_helper'
require 'changeset_controller'
-# Re-raise errors caught by the controller.
-class ChangesetController; def rescue_action(e) raise e end; end
-
- class ChangesetControllerTest < Test::Unit::TestCase
+class ChangesetControllerTest < ActionController::TestCase
api_fixtures
-
-
-
- def setup
- @controller = ChangesetController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
def basic_authorization(user, pass)
@request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
require File.dirname(__FILE__) + '/../test_helper'
require 'geocoder_controller'
-# Re-raise errors caught by the controller.
-class GeocoderController; def rescue_action(e) raise e end; end
-
-class GeocoderControllerTest < Test::Unit::TestCase
- def setup
- @controller = GeocoderController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
+class GeocoderControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
require File.dirname(__FILE__) + '/../test_helper'
require 'message_controller'
-# Re-raise errors caught by the controller.
-class MessageController; def rescue_action(e) raise e end; end
-
-class MessageControllerTest < Test::Unit::TestCase
- def setup
- @controller = MessageController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
+class MessageControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
require File.dirname(__FILE__) + '/../test_helper'
require 'node_controller'
-# Re-raise errors caught by the controller.
-class NodeController; def rescue_action(e) raise e end; end
-
-class NodeControllerTest < Test::Unit::TestCase
+class NodeControllerTest < ActionController::TestCase
api_fixtures
- def setup
- @controller = NodeController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
def test_create
# cannot read password from fixture as it is stored as MD5 digest
basic_authorization(users(:normal_user).email, "test");
require File.dirname(__FILE__) + '/../test_helper'
require 'old_node_controller'
-# Re-raise errors caught by the controller.
-class OldNodeController; def rescue_action(e) raise e end; end
-
-class OldNodeControllerTest < Test::Unit::TestCase
+class OldNodeControllerTest < ActionController::TestCase
api_fixtures
- def setup
- @controller = OldNodeController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
#
# TODO: test history
#
require File.dirname(__FILE__) + '/../test_helper'
require 'old_relation_controller'
-# Re-raise errors caught by the controller.
-#class OldRelationController; def rescue_action(e) raise e end; end
-
-class OldRelationControllerTest < Test::Unit::TestCase
+class OldRelationControllerTest < ActionController::TestCase
api_fixtures
- def setup
- @controller = OldRelationController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
# -------------------------------------
# Test reading old relations.
# -------------------------------------
-
def test_history
# check that a visible relations is returned properly
get :history, :id => relations(:visible_relation).id
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
- end
-
# -------------------------------------
# Test reading old ways.
# -------------------------------------
require File.dirname(__FILE__) + '/../test_helper'
require 'relation_controller'
-# Re-raise errors caught by the controller.
-class RelationController; def rescue_action(e) raise e end; end
-
-class RelationControllerTest < Test::Unit::TestCase
+class RelationControllerTest < ActionController::TestCase
api_fixtures
- def setup
- @controller = RelationController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
def basic_authorization(user, pass)
@request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
end
require File.dirname(__FILE__) + '/../test_helper'
require 'way_controller'
-# Re-raise errors caught by the controller.
-class WayController; def rescue_action(e) raise e end; end
-
-class WayControllerTest < Test::Unit::TestCase
+class WayControllerTest < ActionController::TestCase
api_fixtures
- def setup
- @controller = WayController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
def basic_authorization(user, pass)
@request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
end
# Load standard fixtures needed to test API methods
def self.api_fixtures
- print "setting up the api_fixtures"
+ #print "setting up the api_fixtures"
fixtures :users, :changesets
fixtures :current_nodes, :nodes