Refactor the from_xml methods to act on existing trace objects.
Setting the new tags with the = operator takes care of removing the old ones, and is the same approach as taken by the tagstring= method. Fixes #1600
This commit is contained in:
parent
e9324ad681
commit
c647aa3d4d
3 changed files with 16 additions and 25 deletions
|
@ -942,7 +942,10 @@ class TraceControllerTest < ActionController::TestCase
|
|||
assert_response :success
|
||||
|
||||
updated = Trace.find(trace.id)
|
||||
assert_equal trace.tags, updated.tags
|
||||
# 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
|
||||
|
||||
# Check deleting a trace through the api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue