+ # click job link, if in pipeline page
+ click_link 'foo' if pipeline_page
+
+ if objects_readable
+ assert_selector 'a[href="#Log"]', text: 'Log'
+ assert_no_selector 'a[data-toggle="disabled"]', text: 'Log'
+ assert_no_text 'zzzzz-4zz18-bv31uwvy3neko21 (Unavailable)'
+ if pipeline_page
+ assert_text 'This pipeline was created from'
+ job_id = object['components']['foo']['job']['uuid']
+ assert_selector 'a', text: job_id
+ assert_selector "a[href=\"/jobs/#{job_id}#Log\"]", text: 'Log'
+
+ # We'd like to test the Log tab on job pages too, but we can't right
+ # now because Poltergeist 1.x doesn't support JavaScript's
+ # Function.prototype.bind, which is used by job_log_graph.js.
+ find(:xpath, "//a[@href='#Log']").click
+ assert_text expect_log_text
+ end
+ else
+ assert_selector 'a[data-toggle="disabled"]', text: 'Log'
+ assert_text 'zzzzz-4zz18-bv31uwvy3neko21 (Unavailable)'
+ assert_text object['job']
+ if pipeline_page
+ assert_no_text 'This pipeline was created from' # template is not readable
+ assert_no_selector 'a', text: object['components']['foo']['job']['uuid']
+ assert_text 'Log unavailable'
+ end
+ find(:xpath, "//a[@href='#Log']").click
+ assert_text 'zzzzz-4zz18-bv31uwvy3neko21 (Unavailable)'
+ assert_no_text expect_log_text