+ # Test that updating a trace doesn't duplicate the tags
+ def test_api_update_tags
+ tracetag = create(:tracetag)
+ trace = tracetag.trace
+ basic_authorization trace.user.display_name, "test"
+
+ content trace.to_xml
+ put :api_update, :params => { :id => trace.id }
+ assert_response :success
+
+ updated = Trace.find(trace.id)
+ # Ensure there's only one tag in the database after updating
+ assert_equal Tracetag.count, 1
+ # The new tag object might have a different id, so check the string representation
+ assert_equal trace.tagstring, updated.tagstring
+ end
+