Merge remote-tracking branch 'origin/master' into 2884-improved-picker
[arvados.git] / services / api / test / functional / arvados / v1 / links_controller_test.rb
index 804e1bdfdb1260abe075ceecba6710d84e03050a..d5b42665c38b8599c5fa0e3bc088d851469f4f33 100644 (file)
@@ -270,4 +270,17 @@ class Arvados::V1::LinksControllerTest < ActionController::TestCase
     assert_response :success
   end
 
+  test "refuse duplicate name" do
+    the_name = links(:job_name_in_aproject).name
+    the_project = links(:job_name_in_aproject).tail_uuid
+    authorize_with :active
+    post :create, link: {
+      tail_uuid: the_project,
+      head_uuid: specimens(:owned_by_active_user).uuid,
+      link_class: 'name',
+      name: the_name,
+      properties: {this_s: "a duplicate name"}
+    }
+    assert_response 422
+  end
 end