Merge branch '16492-websocket-extensions-gem-upgrade'
[arvados.git] / apps / workbench / test / helpers / collections_helper_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'test_helper'
6
7 class CollectionsHelperTest < ActionView::TestCase
8   reset_api_fixtures :after_each_test, false
9
10   [
11     ["filename.csv", true],
12     ["filename.fa", true],
13     ["filename.fasta", true],
14     ["filename.seq", true],   # another fasta extension
15     ["filename.go", true],
16     ["filename.htm", true],
17     ["filename.html", true],
18     ["filename.json", true],
19     ["filename.md", true],
20     ["filename.pdf", true],
21     ["filename.py", true],
22     ["filename.R", true],
23     ["filename.sam", true],
24     ["filename.sh", true],
25     ["filename.txt", true],
26     ["filename.tiff", true],
27     ["filename.tsv", true],
28     ["filename.vcf", true],
29     ["filename.xml", true],
30     ["filename.xsl", true],
31     ["filename.yml", true],
32     ["filename.yaml", true],
33     ["filename.bed", true],
34     ["filename.cwl", true],
35
36     ["filename.bam", false],
37     ["filename.tar", false],
38     ["filename", false],
39   ].each do |file_name, preview_allowed|
40     test "verify '#{file_name}' is allowed for preview #{preview_allowed}" do
41       assert_equal preview_allowed, preview_allowed_for(file_name)
42     end
43   end
44 end