[ARVADOS] updated: dc29394d6e4df36a1cab5beae69c3331e037bdb1

git at public.curoverse.com git at public.curoverse.com
Tue Sep 30 00:49:26 EDT 2014


Summary of changes:
 .../arvados/v1/groups_controller_test.rb           | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

       via  dc29394d6e4df36a1cab5beae69c3331e037bdb1 (commit)
      from  99ba15c7f425c042fb61b454bba27324c80b7649 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit dc29394d6e4df36a1cab5beae69c3331e037bdb1
Author: Tim Pierce <twp at curoverse.com>
Date:   Tue Sep 30 00:42:16 2014 -0400

    3961: test creating subprojects under home with duplicate names
    
    New tests:
    * unprivileged user creating a subproject under their home project, with
      an existing name, returns 422
    * unprivileged user creating a subproject under their home project, with
      an existing name, and ensure_unique_name=true, succeeds

diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb
index de339c9..5a67b5c 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -329,4 +329,31 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
                     users(:admin).uuid,
                     "Current user should be included in 'writable_by' field")
   end
+
+  test 'creating subproject with duplicate name fails' do
+    authorize_with :active
+    post :create, {
+      group: {
+        name: 'A Project',
+        owner_uuid: users(:active).uuid,
+        group_class: 'project',
+      },
+    }
+    assert_response 422
+  end
+
+  test 'creating duplicate named subproject succeeds with ensure_unique_name' do
+    authorize_with :active
+    post :create, {
+      group: {
+        name: 'A Project',
+        owner_uuid: users(:active).uuid,
+        group_class: 'project',
+      },
+      ensure_unique_name: true
+    }
+    assert_response :success
+    assert_not_equal json_response['uuid'], groups(:aproject).uuid
+    assert_equal json_response['name'], 'A Project (2)'
+  end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list