manifest_text: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n"
name: collection to remove and rename files
+trashed_collection_to_test_name_conflict_on_untrash:
+ uuid: zzzzz-4zz18-trashedcolnamec
+ portable_data_hash: 80cf6dd2cf079dd13f272ec4245cb4a8+48
+ owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ created_at: 2014-02-03T17:22:54Z
+ modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+ modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+ modified_at: 2014-02-03T17:22:54Z
+ updated_at: 2014-02-03T17:22:54Z
+ manifest_text: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n"
+ name: same name for trashed and persisted collections
+ is_trashed: true
+ trash_at: 2001-01-01T00:00:00Z
+ delete_at: 2038-01-01T00:00:00Z
+
+same_name_as_trashed_coll_to_test_name_conflict_on_untrash:
+ uuid: zzzzz-4zz18-namesameastrash
+ portable_data_hash: 80cf6dd2cf079dd13f272ec4245cb4a8+48
+ owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ created_at: 2014-02-03T17:22:54Z
+ modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+ modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+ modified_at: 2014-02-03T17:22:54Z
+ updated_at: 2014-02-03T17:22:54Z
+ manifest_text: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n"
+ name: same name for trashed and persisted collections
# Test Helper trims the rest of the file
end
end
end
+
+ test 'untrash collection with same name as another with no ensure unique name' do
+ authorize_with :active
+ post :untrash, {
+ id: collections(:trashed_collection_to_test_name_conflict_on_untrash).uuid,
+ }
+ assert_response 422
+ end
+
+ test 'untrash collection with same name as another with ensure unique name' do
+ authorize_with :active
+ post :untrash, {
+ id: collections(:trashed_collection_to_test_name_conflict_on_untrash).uuid,
+ ensure_unique_name: true
+ }
+ assert_response 200
+ assert_equal false, json_response['is_trashed']
+ assert_nil json_response['trash_at']
+ assert_nil json_response['delete_at']
+ assert_match /^same name for trashed and persisted collections \(\d{4}-\d\d-\d\d.*?Z\)$/, json_response['name']
+ end
end