- [nil, nil],
- ['active', api_fixture('users')['active']],
- ].each do |token, user, is_active|
- test "visit public project as user #{token} when anonymous browsing is not enabled" do
- Rails.configuration.anonymous_user_token = false
+ ['All pipelines', 'Pipeline in publicly accessible project'],
+ ['All jobs', 'job submitted'],
+ ['All collections', 'GNU_General_Public_License,_version_3.pdf'],
+ ].each do |selector, expectation|
+ test "verify dashboard when anonymous user accesses shared project and click #{selector}" do
+ visit_publicly_accessible_project
+
+ # go to dashboard
+ click_link 'You are viewing public data'
+
+ assert_no_selector 'a', text: 'Run a pipeline'
+ assert_selector 'a', text: selector
+ click_link selector
+ assert_text expectation
+ end
+ end
+
+ test "anonymous user accesses data collections tab in shared project" do
+ visit_publicly_accessible_project
+
+ assert_selector 'a', text: 'Data collections (1)'
+
+ # click on show collection
+ within first('tr[data-kind="arvados#collection"]') do
+ click_link 'Show'
+ end
+
+ # in collection page
+ assert_no_selector 'input', text: 'Create sharing link'
+ assert_no_selector 'a', text: 'Upload'
+ assert_no_selector 'button', 'Selection'
+
+ within ('#collection_files') do
+ assert_text 'GNU_General_Public_License,_version_3.pdf'
+ # how do i assert the view and download link existence?
+ end
+ end