Fix labels issuable link specs

This commit is contained in:
Sean McGivern 2019-07-30 13:29:17 +01:00
parent c4a8f45f7d
commit 4d90aa83a0
3 changed files with 40 additions and 15 deletions

View File

@ -11,7 +11,9 @@ describe 'Groups > Labels > User sees links to issuables' do
end
it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests')
expect(page).to have_link('view open issues')
page.within('.labels-container') do
expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end
end

View File

@ -19,8 +19,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public) }
it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests')
expect(page).to have_link('view open issues')
page.within('.labels-container') do
expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end
end
@ -28,8 +30,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, issues_access_level: ProjectFeature::DISABLED) }
it 'shows links to MRs but not to issues' do
expect(page).to have_link('view merge requests')
expect(page).not_to have_link('view open issues')
page.within('.labels-container') do
expect(page).to have_link('Merge requests')
expect(page).not_to have_link('Issues')
end
end
end
@ -37,8 +41,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, merge_requests_access_level: ProjectFeature::DISABLED) }
it 'shows links to issues but not to MRs' do
expect(page).not_to have_link('view merge requests')
expect(page).to have_link('view open issues')
page.within('.labels-container') do
expect(page).not_to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end
end
end
@ -51,8 +57,10 @@ describe 'Projects > Labels > User sees links to issuables' do
let(:project) { create(:project, :public, namespace: group) }
it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests')
expect(page).to have_link('view open issues')
page.within('.labels-container') do
expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end
end
@ -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) }
it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests')
expect(page).to have_link('view open issues')
page.within('.labels-container') do
expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end
end
@ -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) }
it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests')
expect(page).to have_link('view open issues')
page.within('.labels-container') do
expect(page).to have_link('Merge requests')
expect(page).to have_link('Issues')
end
end
end
end

View File

@ -7,9 +7,20 @@ describe 'shared/_label_row.html.haml' do
}
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
before do
if label.project_label?
@project = label.project
else
@group = label.group
end
end
it 'has a non-linked label title' do
render 'shared/label_row', label: label