collection_uuid = api_fixture('collections')['foo_file']['uuid']
collection_name = api_fixture('collections')['foo_file']['name']
project_uuid = api_fixture('groups')['aproject']['uuid']
collection_uuid = api_fixture('collections')['foo_file']['uuid']
collection_name = api_fixture('collections')['foo_file']['name']
project_uuid = api_fixture('groups')['aproject']['uuid']
click_link 'Copy to project...'
find('.selectable', text: project_name).click
find('.modal-footer a,button', text: 'Copy').click
click_link 'Copy to project...'
find('.selectable', text: project_name).click
find('.modal-footer a,button', text: 'Copy').click
- wait_for_ajax
- # It should navigate to the project after copying...
- assert(page.has_text?(project_name))
- assert(page.has_text?("Copy of #{collection_name}"))
+ # Should navigate to the Data collections tab of the project after copying
+ assert_text project_name
+ assert_text "Copy of #{collection_name}"
uuid = api_fixture('collections')['foo_file']['uuid']
coll_name = api_fixture('collections')['foo_file']['name']
visit page_with_token('active', "/collections/#{uuid}")
uuid = api_fixture('collections')['foo_file']['uuid']
coll_name = api_fixture('collections')['foo_file']['name']
visit page_with_token('active', "/collections/#{uuid}")
coll_uuid = api_fixture("collections", "collection_owned_by_active", "uuid")
download_link_re =
Regexp.new(Regexp.escape("/collections/download/#{coll_uuid}/"))
coll_uuid = api_fixture("collections", "collection_owned_by_active", "uuid")
download_link_re =
Regexp.new(Regexp.escape("/collections/download/#{coll_uuid}/"))
CollectionsController.any_instance.
stubs(:file_enumerator).returns(["foo\n", "file\n"])
uuid = api_fixture('collections')['foo_file']['uuid']
CollectionsController.any_instance.
stubs(:file_enumerator).returns(["foo\n", "file\n"])
uuid = api_fixture('collections')['foo_file']['uuid']
uuid = 'd41d8cd98f00b204e9800998ecf8427e+0'
visit page_with_token('active', "/collections/#{uuid}")
uuid = 'd41d8cd98f00b204e9800998ecf8427e+0'
visit page_with_token('active', "/collections/#{uuid}")
foo_collection = api_fixture('collections')['foo_file']
bar_collection = api_fixture('collections')['bar_file']
foo_collection = api_fixture('collections')['foo_file']
bar_collection = api_fixture('collections')['bar_file']
assert(page.has_text?('bar'), "Collection page did not include bar file")
assert(page.has_text?('Created new collection in your Home project'),
'Not found flash message that new collection is created in Home project')
assert(page.has_text?('bar'), "Collection page did not include bar file")
assert(page.has_text?('Created new collection in your Home project'),
'Not found flash message that new collection is created in Home project')
['project_viewer', 'foo_collection_in_aproject', false], #aproject not writable
].each do |user, collection, expect_collection_in_aproject|
test "combine selected collection files into new collection #{user} #{collection} #{expect_collection_in_aproject}" do
['project_viewer', 'foo_collection_in_aproject', false], #aproject not writable
].each do |user, collection, expect_collection_in_aproject|
test "combine selected collection files into new collection #{user} #{collection} #{expect_collection_in_aproject}" do
my_collection = api_fixture('collections')[collection]
visit page_with_token(user, "/collections")
my_collection = api_fixture('collections')[collection]
visit page_with_token(user, "/collections")
assert page.has_text?("Created new collection in your Home project"),
'Not found flash message that new collection is created in Home project'
end
assert page.has_text?("Created new collection in your Home project"),
'Not found flash message that new collection is created in Home project'
end
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')
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')
col = api_fixture('collections', 'multilevel_collection_1')
visit page_with_token('active', "/collections/#{col['uuid']}")
col = api_fixture('collections', 'multilevel_collection_1')
visit page_with_token('active', "/collections/#{col['uuid']}")
# make sure that we actually are looking at the collections
# page and not e.g. a fiddlesticks
assert page.has_text?("multilevel_collection_1")
# make sure that we actually are looking at the collections
# page and not e.g. a fiddlesticks
assert page.has_text?("multilevel_collection_1")
# Set filename filter to a syntactically invalid regex
# Page loads, but stops filtering after the last valid regex parse
page.find_field('file_regex').set('file[2')
assert page.has_text?("multilevel_collection_1")
# Set filename filter to a syntactically invalid regex
# Page loads, but stops filtering after the last valid regex parse
page.find_field('file_regex').set('file[2')
assert page.has_text?("multilevel_collection_1")
assert page.has_text?("file1")
assert page.has_text?("file2")
assert page.has_text?("file3")
assert page.has_text?("file1")
assert page.has_text?("file2")
assert page.has_text?("file3")
col = api_fixture('collections', 'collection_with_files_in_subdir')
visit page_with_token('user1_with_load', "/collections/#{col['uuid']}")
assert page.has_text?('file_in_subdir1'), 'expected file_in_subdir1 not found'
col = api_fixture('collections', 'collection_with_files_in_subdir')
visit page_with_token('user1_with_load', "/collections/#{col['uuid']}")
assert page.has_text?('file_in_subdir1'), 'expected file_in_subdir1 not found'
- assert page.has_text?('Content hash:'), 'not on new collection page'
- assert page.has_no_text?(col['uuid']), 'new collection page has old collection uuid'
- assert page.has_no_text?(col['portable_data_hash']), 'new collection page has old portable_data_hash'
-
# must have files in subdir1 and subdir3 but not subdir4
assert page.has_text?('file_in_subdir1'), 'file_in_subdir1 missing from new collection'
assert page.has_text?('file1_in_subdir3'), 'file1_in_subdir3 missing from new collection'
assert page.has_text?('file2_in_subdir3'), 'file2_in_subdir3 missing from new collection'
assert page.has_no_text?('file1_in_subdir4'), 'file1_in_subdir4 found in new collection'
assert page.has_no_text?('file2_in_subdir4'), 'file2_in_subdir4 found in new collection'
# must have files in subdir1 and subdir3 but not subdir4
assert page.has_text?('file_in_subdir1'), 'file_in_subdir1 missing from new collection'
assert page.has_text?('file1_in_subdir3'), 'file1_in_subdir3 missing from new collection'
assert page.has_text?('file2_in_subdir3'), 'file2_in_subdir3 missing from new collection'
assert page.has_no_text?('file1_in_subdir4'), 'file1_in_subdir4 found in new collection'
assert page.has_no_text?('file2_in_subdir4'), 'file2_in_subdir4 found in new collection'