Merge branch 'master' into 4228-collection-subdir-files
authorradhika <radhika@curoverse.com>
Thu, 23 Oct 2014 20:52:06 +0000 (16:52 -0400)
committerradhika <radhika@curoverse.com>
Thu, 23 Oct 2014 20:52:06 +0000 (16:52 -0400)
Conflicts:
apps/workbench/test/integration/collections_test.rb

apps/workbench/app/controllers/actions_controller.rb
apps/workbench/test/integration/collections_test.rb
services/api/test/fixtures/collections.yml

index 62533d81b4ab0a50927379401443dab54f4169e8..59dcbb92bb9c57db69fc15277233a0072fd73dac 100644 (file)
@@ -150,7 +150,7 @@ class ActionsController < ApplicationController
     files.each do |m|
       mt = chash[m[1]+m[2]].andand.manifest_text
       if not m[4].nil? and m[4].size > 1
-        combined += arv_normalize mt, '--extract', m[4][1..-1]
+        combined += arv_normalize mt, '--extract', ".#{m[4]}"
       else
         combined += mt
       end
index 2847a3c794239968e3abb4c7fca5234a14b6962e..625e4819ecec55b46ad5cc2b113b9754d2f27e90 100644 (file)
@@ -148,6 +148,34 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     end
   end
 
+  test "combine selected collection files from collection subdirectory" do
+    headless = Headless.new
+    headless.start
+    Capybara.current_driver = :selenium
+
+    visit page_with_token('user1_with_load', "/collections/zzzzz-4zz18-filesinsubdir00")
+
+    # now in collection page
+    input_files = page.all('input[type=checkbox]')
+    (0..input_files.count-1).each do |i|
+      input_files[i].click
+    end
+
+    click_button 'Selection...'
+    within('.selection-action-container') do
+      click_link 'Create new collection with selected files'
+    end
+
+    # now in the newly created collection page
+    assert(page.has_text?('file_in_subdir1'), 'file not found - file_in_subdir1')
+    assert(page.has_text?('file1_in_subdir3.txt'), 'file not found - file1_in_subdir3.txt')
+    assert(page.has_text?('file2_in_subdir3.txt'), 'file not found - file2_in_subdir3.txt')
+    assert(page.has_text?('file1_in_subdir4.txt'), 'file not found - file1_in_subdir4.txt')
+    assert(page.has_text?('file2_in_subdir4.txt'), 'file not found - file1_in_subdir4.txt')
+
+    headless.stop
+  end
+
   test "Collection portable data hash redirect" do
     di = api_fixture('collections')['docker_image']
     visit page_with_token('active', "/collections/#{di['portable_data_hash']}")
@@ -172,5 +200,4 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert page.has_no_text?("Activity")
     assert page.has_no_text?("Sharing and permissions")
   end
-
 end
index c481424d6d29160778ee7843f2da9bb4a65994a8..045e1c71903aa121478001a7b4f79cd53ab6b221 100644 (file)
@@ -267,6 +267,18 @@ collection_to_remove_from_subproject:
   created_at: 2014-10-15T10:45:00
   name: Collection to remove from subproject
 
+collection_with_files_in_subdir:
+  uuid: zzzzz-4zz18-filesinsubdir00
+  name: collection_files_in_subdir
+  portable_data_hash: 85877ca2d7e05498dd3d109baf2df106+95
+  owner_uuid: zzzzz-tpzed-user1withloadab
+  created_at: 2014-02-03T17:22:54Z
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-user1withloadab
+  modified_at: 2014-02-03T17:22:54Z
+  updated_at: 2014-02-03T17:22:54Z
+  manifest_text: ". 85877ca2d7e05498dd3d109baf2df106+95+A3a4e26a366ee7e4ed3e476ccf05354761be2e4ae@545a9920 0:95:file_in_subdir1\n./subdir2/subdir3 2bbc341c702df4d8f42ec31f16c10120+64+A315d7e7bad2ce937e711fc454fae2d1194d14d64@545a9920 0:32:file1_in_subdir3.txt 32:32:file2_in_subdir3.txt\n./subdir2/subdir3/subdir4 2bbc341c702df4d8f42ec31f16c10120+64+A315d7e7bad2ce937e711fc454fae2d1194d14d64@545a9920 0:32:file1_in_subdir4.txt 32:32:file2_in_subdir4.txt"
+
 # Test Helper trims the rest of the file
 
 # Do not add your fixtures below this line as the rest of this file will be trimmed by test_helper