class WayControllerTest < ActionController::TestCase
api_fixtures
- def basic_authorization(user, pass)
- @request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
- end
-
- def content(c)
- @request.env["RAW_POST_DATA"] = c.to_s
- end
-
# -------------------------------------
# Test reading ways.
# -------------------------------------
put :update, :id => current_ways(:visible_way).id
assert_response :bad_request,
"adding a duplicate tag to a way should fail with 'bad request'"
+ assert_equal "Element way/#{current_ways(:visible_way).id} has duplicate tags with key #{current_way_tags(:t1).k}.", @response.body
end
##
put :update, :id => current_ways(:visible_way).id
assert_response :bad_request,
"adding new duplicate tags to a way should fail with 'bad request'"
+ assert_equal "Element way/#{current_ways(:visible_way).id} has duplicate tags with key i_am_a_duplicate.", @response.body
end
##
put :create
assert_response :bad_request,
"adding new duplicate tags to a way should fail with 'bad request'"
+ assert_equal "Element way/ has duplicate tags with key addr:housenumber.", @response.body
end
##