From 8640b294faa1f2f99e72ec46d36ba4873d8d3f5b Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 4 Oct 2017 11:32:56 -0500 Subject: Add extra assertions about how the link will open --- spec/features/projects/artifacts/browse_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/features/projects/artifacts/browse_spec.rb b/spec/features/projects/artifacts/browse_spec.rb index 1bfdf3c2727..fe485334192 100644 --- a/spec/features/projects/artifacts/browse_spec.rb +++ b/spec/features/projects/artifacts/browse_spec.rb @@ -35,7 +35,10 @@ feature 'Browse artifact', :js do it "shows external link icon and styles" do link = first('.tree-item-file-external-link') - expect(link).to have_content('doc_sample.txt') + expect(page).to have_link('doc_sample.txt', href: file_project_job_artifacts_path(project, job, path: txt_entry.blob.path)) + expect(link[:target]).to eq('_blank') + expect(link[:rel]).to include('noopener') + expect(link[:rel]).to include('noreferrer') expect(page).to have_selector('.js-artifact-tree-external-icon') end end -- cgit v1.2.1