1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'changeset_controller'
4 # Re-raise errors caught by the controller.
5 class ChangesetController; def rescue_action(e) raise e end; end
7 class ChangesetControllerTest < Test::Unit::TestCase
13 @controller = ChangesetController.new
14 @request = ActionController::TestRequest.new
15 @response = ActionController::TestResponse.new
18 def basic_authorization(user, pass)
19 @request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
23 @request.env["RAW_POST_DATA"] = c.to_s
26 # -----------------------
27 # Test simple changeset creation
28 # -----------------------
31 basic_authorization "test@openstreetmap.org", "test"
33 # Create the first user's changeset
34 content "<osm><changeset>" +
35 "<tag k='created_by' v='osm test suite checking changesets'/>" +
39 assert_response :success, "Creation of changeset did not return sucess status"
40 newid = @response.body
43 def test_create_invalid
44 basic_authorization "test@openstreetmap.org", "test"
45 content "<osm><changeset></osm>"