diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-20 12:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-20 12:08:43 +0300 |
commit | bc12365ae0254332f97299138f019bea3ff12351 (patch) | |
tree | c3a65a5523b0b0455780b17d11e0d7039355baa7 /spec/features/incidents/user_creates_new_incident_spec.rb | |
parent | 99551d44588b9c815df9691c8e619eb8beaa0045 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/incidents/user_creates_new_incident_spec.rb')
-rw-r--r-- | spec/features/incidents/user_creates_new_incident_spec.rb | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/spec/features/incidents/user_creates_new_incident_spec.rb b/spec/features/incidents/user_creates_new_incident_spec.rb index 9b9cf396c0a..99a137b5852 100644 --- a/spec/features/incidents/user_creates_new_incident_spec.rb +++ b/spec/features/incidents/user_creates_new_incident_spec.rb @@ -5,34 +5,51 @@ require 'spec_helper' RSpec.describe 'Incident Management index', :js do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user) } + let_it_be(:guest) { create(:user) } let_it_be(:incident) { create(:incident, project: project) } before_all do project.add_developer(developer) + project.add_guest(guest) end - before do - sign_in(developer) - - visit project_incidents_path(project) - wait_for_requests - end - - context 'when a developer displays the incident list' do + shared_examples 'create incident form' do it 'shows the create new issue button' do expect(page).to have_selector('.create-incident-button') end - it 'shows the create issue page with the Incident type pre-selected when clicked' do + it 'when clicked shows the create issue page with the Incident type pre-selected' do find('.create-incident-button').click - wait_for_requests + wait_for_all_requests - expect(page).to have_selector(".dropdown-menu-toggle") - expect(page).to have_selector(".js-issuable-type-filter-dropdown-wrap") + expect(page).to have_selector('.dropdown-menu-toggle') + expect(page).to have_selector('.js-issuable-type-filter-dropdown-wrap') page.within('.js-issuable-type-filter-dropdown-wrap') do expect(page).to have_content('Incident') end end end + + context 'when a developer displays the incident list' do + before do + sign_in(developer) + + visit project_incidents_path(project) + wait_for_all_requests + end + + it_behaves_like 'create incident form' + end + + context 'when a guest displays the incident list' do + before do + sign_in(guest) + + visit project_incidents_path(project) + wait_for_all_requests + end + + it_behaves_like 'create incident form' + end end |