Skip to content
代码片段 群组 项目
未验证 提交 fe6e2b98 编辑于 作者: Peter Leitzen's avatar Peter Leitzen
浏览文件

Verify that Incidents were visible for guest users as well

上级 605796d6
No related branches found
No related tags found
无相关合并请求
...@@ -13,12 +13,17 @@ ...@@ -13,12 +13,17 @@
let_it_be(:label2) { create(:label, project: project) } let_it_be(:label2) { create(:label, project: project) }
let_it_be(:issue) { create(:issue, project: project, assignees: [user], milestone: milestone) } let_it_be(:issue) { create(:issue, project: project, assignees: [user], milestone: milestone) }
before do let(:current_user) { user }
stub_licensed_features(multiple_issue_assignees: false, issue_weights: false)
before_all do
project.add_maintainer(user) project.add_maintainer(user)
project.add_maintainer(user2) project.add_maintainer(user2)
sign_in(user) end
before do
stub_licensed_features(multiple_issue_assignees: false, issue_weights: false)
sign_in(current_user)
end end
describe 'new issue' do describe 'new issue' do
...@@ -234,24 +239,35 @@ ...@@ -234,24 +239,35 @@
end end
describe 'displays issue type options in the dropdown' do describe 'displays issue type options in the dropdown' do
shared_examples 'type option is visible' do |label:, identifier:|
it "shows #{identifier} option", :aggregate_failures do
page.within('[data-testid="issue-type-select-dropdown"]') do
expect(page).to have_selector(%([data-testid="issue-type-#{identifier}-icon"]))
expect(page).to have_content(label)
end
end
end
before do before do
page.within('.issue-form') do page.within('.issue-form') do
click_button 'Issue' click_button 'Issue'
end end
end end
it 'correctly displays the Issue type option with an icon', :aggregate_failures do it_behaves_like 'type option is visible', label: 'Issue', identifier: :issue
page.within('[data-testid="issue-type-select-dropdown"]') do it_behaves_like 'type option is visible', label: 'Incident', identifier: :incident
expect(page).to have_selector('[data-testid="issue-type-issue-icon"]')
expect(page).to have_content('Issue')
end
end
it 'correctly displays the Incident type option with an icon', :aggregate_failures do context 'when user is guest' do
page.within('[data-testid="issue-type-select-dropdown"]') do let_it_be(:guest) { create(:user) }
expect(page).to have_selector('[data-testid="issue-type-incident-icon"]')
expect(page).to have_content('Incident') let(:current_user) { guest }
before_all do
project.add_guest(guest)
end end
it_behaves_like 'type option is visible', label: 'Issue', identifier: :issue
it_behaves_like 'type option is visible', label: 'Incident', identifier: :incident
end end
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册