Merge branch '10032-cwl-spinup' refs #10032
[arvados.git] / apps / workbench / test / helpers / collections_helper_test.rb
1 require 'test_helper'
2
3 class CollectionsHelperTest < ActionView::TestCase
4   reset_api_fixtures :after_each_test, false
5
6   [
7     ["filename.csv", true],
8     ["filename.fa", true],
9     ["filename.fasta", true],
10     ["filename.seq", true],   # another fasta extension
11     ["filename.go", true],
12     ["filename.htm", true],
13     ["filename.html", true],
14     ["filename.json", true],
15     ["filename.md", true],
16     ["filename.pdf", true],
17     ["filename.py", true],
18     ["filename.R", true],
19     ["filename.sam", true],
20     ["filename.sh", true],
21     ["filename.txt", true],
22     ["filename.tiff", true],
23     ["filename.tsv", true],
24     ["filename.vcf", true],
25     ["filename.xml", true],
26     ["filename.xsl", true],
27     ["filename.yml", true],
28
29     ["filename.bam", false],
30     ["filename.tar", false],
31     ["filename", false],
32   ].each do |file_name, preview_allowed|
33     test "verify '#{file_name}' is allowed for preview #{preview_allowed}" do
34       assert_equal preview_allowed, preview_allowed_for(file_name)
35     end
36   end
37 end