[ARVADOS] updated: fe6bad60cace3d6e0f611b1c07fc7f4cb593c48e

git at public.curoverse.com git at public.curoverse.com
Tue Mar 17 20:43:59 EDT 2015


Summary of changes:
 .../controllers/collections_controller_test.rb     | 27 ++++++++++++++++++++++
 services/api/test/fixtures/collections.yml         | 24 +++++++++++++++++++
 2 files changed, 51 insertions(+)

       via  fe6bad60cace3d6e0f611b1c07fc7f4cb593c48e (commit)
      from  12540bb0c62e2a498a70f64198055f1d48deeb17 (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 fe6bad60cace3d6e0f611b1c07fc7f4cb593c48e
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Tue Mar 17 20:42:40 2015 -0400

    5375: add test to verify that collection#show page enalbles / disables file viewing correctly.

diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb
index dfbe69f..17cd741 100644
--- a/apps/workbench/test/controllers/collections_controller_test.rb
+++ b/apps/workbench/test/controllers/collections_controller_test.rb
@@ -403,4 +403,31 @@ class CollectionsControllerTest < ActionController::TestCase
     assert_equal 'test description update', assigns(:object).description
     assert_equal collection['manifest_text'], assigns(:object).manifest_text
   end
+
+  test "view collection and verify none of the file types listed are disabled" do
+    show_collection(:collection_with_several_supported_file_types, :active)
+
+    files = assigns(:object).files
+    assert_equal true, files.length>0, "Expected one or more files in collection"
+
+    disabled = css_select('[disabled="disabled"]').collect do |el|
+      el
+    end
+    assert_equal 0, disabled.length, "Expected no disabled files in collection viewables list"
+  end
+
+  test "view collection and verify file types listed are all disabled" do
+    show_collection(:collection_with_several_unsupported_file_types, :active)
+
+    files = assigns(:object).files.collect do |_, file, _|
+      file
+    end
+    assert_equal true, files.length>0, "Expected one or more files in collection"
+
+    disabled = css_select('[disabled="disabled"]').collect do |el|
+      el.attributes['title'].split[-1]
+    end
+
+    assert_equal files.sort, disabled.sort, "Expected to see all collection files in disabled list of files"
+  end
 end
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index bd508f8..d3e6beb 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -519,6 +519,30 @@ multi_level_to_combine:
   manifest_text: ". 85877ca2d7e05498dd3d109baf2df106+95 0:0:file1 0:0:file2 0:0:file3\n./dir1 85877ca2d7e05498dd3d109baf2df106+95 0:0:file1 0:0:file2 0:0:file3\n./dir1/subdir 85877ca2d7e05498dd3d109baf2df106+95 0:0:file1 0:0:file2 0:0:file3\n./dir2 85877ca2d7e05498dd3d109baf2df106+95 0:0:file1 0:0:file2 0:0:file3\n"
   name: multi_level_to_combine
 
+# collection with several file types to test view icon enabled state in collection show page
+collection_with_several_supported_file_types:
+  uuid: zzzzz-4zz18-supportedtypes1
+  portable_data_hash: 7a6ef4c162a5c6413070a8bd0bffc818+150
+  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: ". 85877ca2d7e05498dd3d109baf2df106+95 0:0:file.csv 0:0:file.fa 0:0:file.fasta 0:0:file.gif 0:0:file.json 0:0:file.md 0:0:file.pdf 0:0:file.py 0:0:file.R 0:0:file.sam 0:0:file.sh 0:0:file.tiff 0:0:file.tsv 0:0:file.txt 0:0:file.vcf 0:0:file.xml 0:0:file.xsl 0:0:file.yml\n"
+  name: collection_with_several_supported_file_types
+
+collection_with_several_unsupported_file_types:
+  uuid: zzzzz-4zz18-supportedtypes2
+  portable_data_hash: 7a6ef4c162a5c6413070a8bd0bffc818+150
+  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: ". 85877ca2d7e05498dd3d109baf2df106+95 0:0:file 0:0:file.bam\n"
+  name: collection_with_several_unsupported_file_types
 
 # Test Helper trims the rest of the file
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list