projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ed1fe2
)
Add failing test demonstrating tag duplication when updating traces via the API.
author
Andy Allan
<git@gravitystorm.co.uk>
Thu, 17 Aug 2017 18:03:50 +0000
(19:03 +0100)
committer
Andy Allan
<git@gravitystorm.co.uk>
Thu, 17 Aug 2017 18:03:50 +0000
(19:03 +0100)
test/controllers/trace_controller_test.rb
patch
|
blob
|
history
diff --git
a/test/controllers/trace_controller_test.rb
b/test/controllers/trace_controller_test.rb
index 4610852fb7d012e63ed4569bdc79bb9bca037749..b635f3e57909edb9f187b566b83ad1fba865182a 100644
(file)
--- a/
test/controllers/trace_controller_test.rb
+++ b/
test/controllers/trace_controller_test.rb
@@
-931,6
+931,20
@@
class TraceControllerTest < ActionController::TestCase
assert_equal nt.visibility, t.visibility
end
assert_equal nt.visibility, t.visibility
end
+ # 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)
+ assert_equal trace.tags, updated.tags
+ end
+
# Check deleting a trace through the api
def test_api_delete
public_trace_file = create(:trace, :visibility => "public")
# Check deleting a trace through the api
def test_api_delete
public_trace_file = create(:trace, :visibility => "public")