diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 00:10:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 00:10:00 +0300 |
commit | e1b5604609766f635f5029382ea018c612aa3186 (patch) | |
tree | fff466ae7fdf9edf47f84f539995292909ce8f94 /spec/features/incidents/user_creates_new_incident_spec.rb | |
parent | efcaec8a140e2b93d1f43d5afd7a5c35cdd4dad7 (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 | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/spec/features/incidents/user_creates_new_incident_spec.rb b/spec/features/incidents/user_creates_new_incident_spec.rb index 99a137b5852..685f6ab791a 100644 --- a/spec/features/incidents/user_creates_new_incident_spec.rb +++ b/spec/features/incidents/user_creates_new_incident_spec.rb @@ -4,52 +4,49 @@ 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(:reporter) { 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_reporter(reporter) project.add_guest(guest) end - shared_examples 'create incident form' do - it 'shows the create new issue button' do - expect(page).to have_selector('.create-incident-button') - end + before do + sign_in(user) - it 'when clicked shows the create issue page with the Incident type pre-selected' do - find('.create-incident-button').click - wait_for_all_requests + visit project_incidents_path(project) + wait_for_all_requests + end - expect(page).to have_selector('.dropdown-menu-toggle') - expect(page).to have_selector('.js-issuable-type-filter-dropdown-wrap') + describe 'incident list is visited' do + context 'by reporter' do + let(:user) { reporter } - page.within('.js-issuable-type-filter-dropdown-wrap') do - expect(page).to have_content('Incident') + it 'shows the create new incident button' do + expect(page).to have_selector('.create-incident-button') end - end - end - context 'when a developer displays the incident list' do - before do - sign_in(developer) + it 'when clicked shows the create issue page with the Incident type pre-selected' do + find('.create-incident-button').click + wait_for_all_requests - visit project_incidents_path(project) - wait_for_all_requests - end + expect(page).to have_selector('.dropdown-menu-toggle') + expect(page).to have_selector('.js-issuable-type-filter-dropdown-wrap') - it_behaves_like 'create incident form' + page.within('.js-issuable-type-filter-dropdown-wrap') do + expect(page).to have_content('Incident') + end + end + end end - context 'when a guest displays the incident list' do - before do - sign_in(guest) + context 'by guest' do + let(:user) { guest } - visit project_incidents_path(project) - wait_for_all_requests + it 'does not show new incident button' do + expect(page).not_to have_selector('.create-incident-button') end - - it_behaves_like 'create incident form' end end |