Commit 4d90aa83 authored by Sean McGivern's avatar Sean McGivern

Fix labels issuable link specs

parent c4a8f45f
...@@ -11,7 +11,9 @@ describe 'Groups > Labels > User sees links to issuables' do ...@@ -11,7 +11,9 @@ describe 'Groups > Labels > User sees links to issuables' do
end end
it 'shows links to MRs and issues' do it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests') page.within('.labels-container') do
expect(page).to have_link('view open issues') expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end end
end end
...@@ -19,8 +19,10 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -19,8 +19,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
it 'shows links to MRs and issues' do it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests') page.within('.labels-container') do
expect(page).to have_link('view open issues') expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end end
end end
...@@ -28,8 +30,10 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -28,8 +30,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, issues_access_level: ProjectFeature::DISABLED) } let(:project) { create(:project, :public, issues_access_level: ProjectFeature::DISABLED) }
it 'shows links to MRs but not to issues' do it 'shows links to MRs but not to issues' do
expect(page).to have_link('view merge requests') page.within('.labels-container') do
expect(page).not_to have_link('view open issues') expect(page).to have_link('Merge requests')
expect(page).not_to have_link('Issues')
end
end end
end end
...@@ -37,8 +41,10 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -37,8 +41,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, merge_requests_access_level: ProjectFeature::DISABLED) } let(:project) { create(:project, :public, merge_requests_access_level: ProjectFeature::DISABLED) }
it 'shows links to issues but not to MRs' do it 'shows links to issues but not to MRs' do
expect(page).not_to have_link('view merge requests') page.within('.labels-container') do
expect(page).to have_link('view open issues') expect(page).not_to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end end
end end
end end
...@@ -51,8 +57,10 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -51,8 +57,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:project, :public, namespace: group) }
it 'shows links to MRs and issues' do it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests') page.within('.labels-container') do
expect(page).to have_link('view open issues') expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end end
end end
...@@ -60,8 +68,10 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -60,8 +68,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, namespace: group, issues_access_level: ProjectFeature::DISABLED) } let(:project) { create(:project, :public, namespace: group, issues_access_level: ProjectFeature::DISABLED) }
it 'shows links to MRs and issues' do it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests') page.within('.labels-container') do
expect(page).to have_link('view open issues') expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end end
end end
...@@ -69,8 +79,10 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -69,8 +79,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, namespace: group, merge_requests_access_level: ProjectFeature::DISABLED) } let(:project) { create(:project, :public, namespace: group, merge_requests_access_level: ProjectFeature::DISABLED) }
it 'shows links to MRs and issues' do it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests') page.within('.labels-container') do
expect(page).to have_link('view open issues') expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end end
end end
end end
......
...@@ -7,9 +7,20 @@ describe 'shared/_label_row.html.haml' do ...@@ -7,9 +7,20 @@ describe 'shared/_label_row.html.haml' do
} }
label_types.each do |label_type, label_factory| label_types.each do |label_type, label_factory|
let!(:label) { create(label_factory) } let!(:label) do
label_record = create(label_factory)
label_record.present(issuable_subject: label_record.subject)
end
context "for a #{label_type}" do context "for a #{label_type}" do
before do
if label.project_label?
@project = label.project
else
@group = label.group
end
end
it 'has a non-linked label title' do it 'has a non-linked label title' do
render 'shared/label_row', label: label render 'shared/label_row', label: label
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment