X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4b8e618c36fae9231601b9012fc18c5c2ee43a90..e7672a0b679659d6ba90d23b4e102fba747fa9ef:/apps/workbench/test/controllers/collections_controller_test.rb diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb index 559e24ad02..1632dd0653 100644 --- a/apps/workbench/test/controllers/collections_controller_test.rb +++ b/apps/workbench/test/controllers/collections_controller_test.rb @@ -506,7 +506,7 @@ class CollectionsControllerTest < ActionController::TestCase collection = api_fixture('collections')['foo_file'] get :show, {id: collection['uuid']}, session_for(:active) assert_includes @response.body, collection['name'] - assert_match /href="#{collection['uuid']}\/foo" ><\/i> foo 'file1' + }, + format: :json + }, session_for(:active) + assert_response 422 + assert_includes json_response['errors'], 'Duplicate file path' + end + + test "renaming file with a duplicate name as another stream not allowed" do + use_token :active + + # rename 'file1' as 'dir1/file1' and expect error + post :update, { + id: 'zzzzz-4zz18-pyw8yp9g3pr7irn', + collection: { + 'rename-file-path:file1' => 'dir1/file1' + }, + format: :json + }, session_for(:active) + assert_response 422 + assert_includes json_response['errors'], 'Duplicate file path' end end