[ARVADOS] updated: cabba9a1b8046d1c75c302659cc23de59689ce69
Git user
git at public.curoverse.com
Thu Jun 22 14:09:22 EDT 2017
Summary of changes:
.../app/views/collections/_show_files.html.erb | 2 +-
.../controllers/collections_controller_test.rb | 22 ++++++++++++++++++----
2 files changed, 19 insertions(+), 5 deletions(-)
via cabba9a1b8046d1c75c302659cc23de59689ce69 (commit)
via d53b4de9b3b23d8fec31be0254a9a0ec4355884a (commit)
from e4cb545184144fa761aa9b692597df8d10e110a4 (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 cabba9a1b8046d1c75c302659cc23de59689ce69
Merge: e4cb545 d53b4de
Author: radhika <radhika at curoverse.com>
Date: Thu Jun 22 14:07:43 2017 -0400
closes #11846
Merge branch '11846-collection-image-file-rename'
Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>
commit d53b4de9b3b23d8fec31be0254a9a0ec4355884a
Author: radhika <radhika at curoverse.com>
Date: Thu Jun 22 10:21:06 2017 -0400
11846: update file path parameter name in renaming collection image files and add a test assertion
Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index 7c7777d..2c568fb 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -108,7 +108,7 @@
<i class="fa fa-fw fa-bar-chart-o"></i>
<% if object.editable? %>
<span class="btn-collection-rename-file-span">
- <%= render_editable_attribute object, 'filename', filename, {'data-value' => file_path, 'data-toggle' => 'manual', 'selection_path' => 'rename-file-path:'+file_path}, {tiptitle: 'Edit name or directory or both for this file', btnclass: 'collection-file-control'} %>
+ <%= render_editable_attribute object, 'filename', filename, {'data-value' => file_path, 'data-toggle' => 'manual', 'selection_name' => 'rename-file-path:'+file_path}, {tiptitle: 'Edit name or directory or both for this file', btnclass: 'collection-file-control'} %>
</span>
<% else %>
<%= filename %>
diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb
index 1632dd0..7ff123c 100644
--- a/apps/workbench/test/controllers/collections_controller_test.rb
+++ b/apps/workbench/test/controllers/collections_controller_test.rb
@@ -686,7 +686,7 @@ class CollectionsControllerTest < ActionController::TestCase
use_token :active
# create a new collection to test
- manifest_text = ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n./dir1 d41d8cd98f00b204e9800998ecf8427e+0 0:0:dir1file1 0:0:dir1file2\n"
+ manifest_text = ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n./dir1 d41d8cd98f00b204e9800998ecf8427e+0 0:0:dir1file1 0:0:dir1file2 0:0:dir1imagefile.png\n"
collection = Collection.create(manifest_text: manifest_text)
assert_includes(collection['manifest_text'], "0:0:file1")
@@ -702,7 +702,7 @@ class CollectionsControllerTest < ActionController::TestCase
assert_response :success
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
- assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed 0:0:file2\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1 0:0:dir1file2\n$/, collection['manifest_text']
+ assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed 0:0:file2\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1 0:0:dir1file2 0:0:dir1imagefile.png\n$/, collection['manifest_text']
# now rename 'file2' such that it is moved into 'dir1'
@test_counter = 0
@@ -716,7 +716,7 @@ class CollectionsControllerTest < ActionController::TestCase
assert_response :success
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
- assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1 0:0:dir1file2 0:0:file2\n$/, collection['manifest_text']
+ assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1 0:0:dir1file2 0:0:dir1imagefile.png 0:0:file2\n$/, collection['manifest_text']
# now rename 'dir1/dir1file1' such that it is moved into a new subdir
@test_counter = 0
@@ -730,7 +730,21 @@ class CollectionsControllerTest < ActionController::TestCase
assert_response :success
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
- assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file2 0:0:file2\n.\/dir2\/dir3 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1moved\n$/, collection['manifest_text']
+ assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file2 0:0:dir1imagefile.png 0:0:file2\n.\/dir2\/dir3 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1moved\n$/, collection['manifest_text']
+
+ # now rename the image file 'dir1/dir1imagefile.png'
+ @test_counter = 0
+ post :update, {
+ id: collection['uuid'],
+ collection: {
+ 'rename-file-path:dir1/dir1imagefile.png' => 'dir1/dir1imagefilerenamed.png'
+ },
+ format: :json
+ }, session_for(:active)
+ assert_response :success
+
+ collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
+ assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file2 0:0:dir1imagefilerenamed.png 0:0:file2\n.\/dir2\/dir3 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1moved\n$/, collection['manifest_text']
end
test "renaming file with a duplicate name in same stream not allowed" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list