+ verify_pipeline_instance_row
+ end
+ end
+ end
+
+ def verify_job_row look_for
+ within first('tr', text: look_for) do
+ click_link 'Show'
+ end
+ assert_text 'Public Projects Unrestricted public data'
+ assert_text 'script_version'
+
+ assert_text 'zzzzz-tpzed-xurymjxw79nv3jz' # modified by user
+ assert_no_selector 'a', text: 'zzzzz-tpzed-xurymjxw79nv3jz'
+ assert_no_selector 'a', text: 'Move job'
+ assert_no_selector 'button', text: 'Cancel'
+ assert_no_selector 'button', text: 'Re-run job'
+ end
+
+ def verify_pipeline_instance_row
+ within first('tr[data-kind="arvados#pipelineInstance"]') do
+ assert_text 'Pipeline in publicly accessible project'
+ click_link 'Show'
+ end
+
+ # in pipeline instance page
+ assert_text 'Public Projects Unrestricted public data'
+ assert_text 'This pipeline is complete'
+ assert_no_selector 'a', text: 'Re-run with latest'
+ assert_no_selector 'a', text: 'Re-run options'
+ end
+
+ test "anonymous user accesses pipeline templates tab in shared project" do
+ visit PUBLIC_PROJECT
+ click_link 'Data collections'
+ assert_text 'GNU General Public License'
+
+ assert_selector 'a', text: 'Pipeline templates'
+
+ click_link 'Pipeline templates'
+ assert_text 'Pipeline template in publicly accessible project'
+
+ within first('tr[data-kind="arvados#pipelineTemplate"]') do
+ click_link 'Show'
+ end
+
+ # in template page
+ assert_text 'Public Projects Unrestricted public data'
+ assert_text 'script version'
+ assert_no_selector 'a', text: 'Run this pipeline'
+ end
+
+ test "anonymous user accesses subprojects tab in shared project" do
+ visit PUBLIC_PROJECT + '#Subprojects'
+
+ assert_text 'Subproject in anonymous accessible project'
+
+ within first('tr[data-kind="arvados#group"]') do
+ click_link 'Show'
+ end
+
+ # in subproject
+ assert_text 'Description for subproject in anonymous accessible project'
+ end
+
+ [
+ ['pipeline_in_publicly_accessible_project', true],
+ ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false],
+ ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false, 'spectator'],
+ ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', true, 'admin'],
+
+ ['completed_job_in_publicly_accessible_project', true],
+ ['job_in_publicly_accessible_project_but_other_objects_elsewhere', false],
+ ].each do |fixture, objects_readable, user=nil|
+ test "access #{fixture} in public project with objects readable=#{objects_readable} with user #{user}" do
+ pipeline_page = true if fixture.include?('pipeline')
+
+ if pipeline_page
+ object = api_fixture('pipeline_instances')[fixture]
+ page = "/pipeline_instances/#{object['uuid']}"
+ expect_log_text = "Log for foo"
+ else # job
+ object = api_fixture('jobs')[fixture]
+ page = "/jobs/#{object['uuid']}"
+ expect_log_text = "stderr crunchstat"