Tidy up user preferences controller

This commit is contained in:
Tom Hughes 2013-05-10 16:03:37 +01:00
parent 083a8bb043
commit c809f79912
3 changed files with 73 additions and 60 deletions

View file

@ -120,9 +120,9 @@ class UserPreferenceControllerTest < ActionController::TestCase
content "<osm><preferences><preference k='key' v='value'/><preference k='key' v='newer_value'/></preferences></osm>"
put :update
end
assert_response :not_acceptable
assert_response :bad_request
assert_equal "text/plain", @response.content_type
assert_equal "OH NOES! CAN HAS UNIQUE KEYS?", @response.body
assert_equal "Duplicate preferences with key key", @response.body
assert_equal "new_value", UserPreference.find(1, "key").v
# try a put with invalid content