1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'api_controller'
4 # Re-raise errors caught by the controller.
5 class ApiController; def rescue_action(e) raise e end; end
7 class ApiControllerTest < Test::Unit::TestCase
11 @controller = ApiController.new
12 @request = ActionController::TestRequest.new
13 @response = ActionController::TestResponse.new
16 def basic_authorization(user, pass)
17 @request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
20 # -------------------------------------
21 # Test reading a bounding box.
22 # -------------------------------------
25 node = current_nodes(:used_node_1)
26 bbox = "#{node.latitude-0.1},#{node.longitude-0.1},#{node.latitude+0.1},#{node.longitude+0.1}"
27 get :map, :bbox => bbox
31 assert_response :success