# Make sure we're not still on the old collection page.
refute_match(%r{/collections/#{col['uuid']}}, page.current_url)
end
+
+ test "remove selected collection files using checkboxes and dropdown option" do
+ visit page_with_token('active', '/collections/zzzzz-4zz18-a21ux3541sxa8sf')
+ assert(page.has_text?('file1'), 'file not found - file1')
+ assert(page.has_text?('file2'), 'file not found - file2')
+
+ # now in collection page
+ # remove first file from both subdirs
+ input_files = page.all('input[type=checkbox]')
+ input_files[0].click
+
+ click_button 'Selection...'
+ within('.selection-action-container') do
+ click_link 'Remove selected files'
+ end
+
+ # now in the newly created collection page
+ assert(page.has_no_text?('file1'), 'file not found - file')
+ assert(page.has_text?('file2'), 'file not found - file2')
+ end
+
+ test "remove a collection file using trash icon" do
+ need_selenium 'to confirm remove'
+
+ visit page_with_token('active', '/collections/zzzzz-4zz18-a21ux3541sxa8sf')
+ assert(page.has_text?('file1'), 'file not found - file1')
+ assert(page.has_text?('file2'), 'file not found - file2')
+
+ # now in collection page
+ first('.fa-trash-o').click
+ alert = page.driver.browser.switch_to.alert
+ alert.accept
+ wait_for_ajax
+
+ # now in the newly created collection page
+ assert(page.has_no_text?('file1'), 'file not found - file')
+ assert(page.has_text?('file2'), 'file not found - file2')
+ end
end
manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
name: collection_not_readable_by_active
+collection_to_remove_and_rename_files:
+ uuid: zzzzz-4zz18-a21ux3541sxa8sf
+ 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: collection to remove and rename files
+
# Test Helper trims the rest of the file