From e9324ad6818cfec0578a8fa4dac0b2724a1445f1 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 17 Aug 2017 19:03:50 +0100 Subject: [PATCH] Add failing test demonstrating tag duplication when updating traces via the API. --- test/controllers/trace_controller_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/controllers/trace_controller_test.rb b/test/controllers/trace_controller_test.rb index 4610852fb..b635f3e57 100644 --- 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 + # 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") -- 2.43.2