[ARVADOS] updated: 823ef13277f4c5fe6711dc320bf9cd2f76492c2e
Git user
git at public.curoverse.com
Mon Mar 27 19:38:10 EDT 2017
Summary of changes:
.../app/controllers/collections_controller.rb | 2 +-
.../workbench/test/integration/collections_test.rb | 38 ++++++++++++++++++++++
services/api/test/fixtures/collections.yml | 12 +++++++
3 files changed, 51 insertions(+), 1 deletion(-)
via 823ef13277f4c5fe6711dc320bf9cd2f76492c2e (commit)
from c33eb3191d36b7e39023db0c0f1790a1bad2c4f0 (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 823ef13277f4c5fe6711dc320bf9cd2f76492c2e
Author: radhika <radhika at curoverse.com>
Date: Mon Mar 27 19:37:45 2017 -0400
3821: integration test to remove files from a collection
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index bac3f8e..02b204f 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -334,7 +334,7 @@ class CollectionsController < ApplicationController
self.render_error status: 422
end
else
- # Non a file rename; use default
+ # Not a file rename; use default
super
end
end
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 8190b35..3d2767a 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -298,4 +298,42 @@ class CollectionsTest < ActionDispatch::IntegrationTest
# 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
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index 5f7bad8..7f5e1f8 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -645,6 +645,18 @@ collection_not_readable_by_active:
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
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list