diff options
Diffstat (limited to 'spec/features')
5 files changed, 66 insertions, 10 deletions
diff --git a/spec/features/dashboard/activity_spec.rb b/spec/features/dashboard/activity_spec.rb index bf91dc121d8..c55dc4523f7 100644 --- a/spec/features/dashboard/activity_spec.rb +++ b/spec/features/dashboard/activity_spec.rb @@ -39,6 +39,8 @@ describe 'Dashboard > Activity' do event end + let(:issue) { create(:issue, project: project) } + let!(:merged_event) do create(:event, :merged, project: project, target: merge_request, author: user) end @@ -59,6 +61,10 @@ describe 'Dashboard > Activity' do create(:event, :closed, project: project, target: milestone, author: user) end + let!(:issue_event) do + create(:event, :created, project: project, target: issue, author: user) + end + before do project.add_maintainer(user) @@ -74,6 +80,7 @@ describe 'Dashboard > Activity' do expect(page).to have_content('closed') expect(page).to have_content('commented on') expect(page).to have_content('closed milestone') + expect(page).to have_content('opened issue') end end @@ -87,6 +94,7 @@ describe 'Dashboard > Activity' do expect(page).not_to have_content('accepted') expect(page).not_to have_content('closed') expect(page).not_to have_content('commented on') + expect(page).not_to have_content('opened issue') end end @@ -100,6 +108,7 @@ describe 'Dashboard > Activity' do expect(page).to have_content('accepted') expect(page).not_to have_content('closed') expect(page).not_to have_content('commented on') + expect(page).not_to have_content('opened issue') end end @@ -111,9 +120,10 @@ describe 'Dashboard > Activity' do expect(page).not_to have_content('pushed new branch') expect(page).not_to have_content('joined') expect(page).not_to have_content('accepted') - expect(page).to have_content('closed') + expect(page).not_to have_content('closed') expect(page).not_to have_content('commented on') - expect(page).to have_content('closed milestone') + expect(page).not_to have_content('closed milestone') + expect(page).to have_content('opened issue') end end @@ -127,6 +137,7 @@ describe 'Dashboard > Activity' do expect(page).not_to have_content('accepted') expect(page).not_to have_content('closed') expect(page).to have_content('commented on') + expect(page).not_to have_content('opened issue') end end @@ -140,6 +151,7 @@ describe 'Dashboard > Activity' do expect(page).not_to have_content('accepted') expect(page).not_to have_content('closed') expect(page).not_to have_content('commented on') + expect(page).not_to have_content('opened issue') end end @@ -155,6 +167,7 @@ describe 'Dashboard > Activity' do expect(page).not_to have_content('accepted') expect(page).not_to have_content('closed') expect(page).not_to have_content('commented on') + expect(page).not_to have_content('opened issue') end end end diff --git a/spec/features/merge_request/maintainer_edits_fork_spec.rb b/spec/features/merge_request/maintainer_edits_fork_spec.rb index aead98dae23..b35f985126c 100644 --- a/spec/features/merge_request/maintainer_edits_fork_spec.rb +++ b/spec/features/merge_request/maintainer_edits_fork_spec.rb @@ -26,7 +26,7 @@ describe 'a maintainer edits files on a source-branch of an MR from a fork', :js visit project_merge_request_path(target_project, merge_request) click_link 'Changes' wait_for_requests - first('.js-file-title').click_link 'Edit' + first('.js-file-title').find('.js-edit-blob').click wait_for_requests end diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index a8a3b6910fb..3090f1a2131 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -120,7 +120,7 @@ describe 'Environment' do end it 'does show a play button' do - expect(page).to have_link(action.name.humanize) + expect(page).to have_link(action.name) end it 'does allow to play manual action', :js do @@ -128,7 +128,7 @@ describe 'Environment' do find('button.dropdown').click - expect { click_link(action.name.humanize) } + expect { click_link(action.name) } .not_to change { Ci::Pipeline.count } wait_for_all_requests @@ -140,7 +140,7 @@ describe 'Environment' do context 'when user has no ability to trigger a deployment' do it 'does not show a play button' do - expect(page).not_to have_link(action.name.humanize) + expect(page).not_to have_link(action.name) end end diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 66c6545204b..b2a435e554d 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -183,14 +183,14 @@ describe 'Environments page', :js do it 'shows a play button' do find('.js-environment-actions-dropdown').click - expect(page).to have_content(action.name.humanize) + expect(page).to have_content(action.name) end it 'allows to play a manual action', :js do expect(action).to be_manual find('.js-environment-actions-dropdown').click - expect(page).to have_content(action.name.humanize) + expect(page).to have_content(action.name) expect { find('.js-manual-action-link').click } .not_to change { Ci::Pipeline.count } @@ -311,7 +311,7 @@ describe 'Environments page', :js do it "has link to the delayed job's action" do find('.js-environment-actions-dropdown').click - expect(page).to have_button('Delayed job') + expect(page).to have_button('delayed job') expect(page).to have_content(/\d{2}:\d{2}:\d{2}/) end @@ -333,7 +333,7 @@ describe 'Environments page', :js do context 'when user played a delayed job immediately' do before do find('.js-environment-actions-dropdown').click - page.accept_confirm { click_button('Delayed job') } + page.accept_confirm { click_button('delayed job') } wait_for_requests end diff --git a/spec/features/projects/settings/project_settings_spec.rb b/spec/features/projects/settings/project_settings_spec.rb new file mode 100644 index 00000000000..7afddc0e712 --- /dev/null +++ b/spec/features/projects/settings/project_settings_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Projects settings' do + set(:project) { create(:project) } + let(:user) { project.owner } + let(:panel) { find('.general-settings', match: :first) } + let(:button) { panel.find('.btn.js-settings-toggle') } + let(:title) { panel.find('.settings-title') } + + before do + sign_in(user) + visit edit_project_path(project) + end + + it 'can toggle sections by clicking the title or button', :js do + expect_toggle_state(:expanded) + + button.click + + expect_toggle_state(:collapsed) + + button.click + + expect_toggle_state(:expanded) + + title.click + + expect_toggle_state(:collapsed) + + title.click + + expect_toggle_state(:expanded) + end + + def expect_toggle_state(state) + is_collapsed = state == :collapsed + + expect(button).to have_content(is_collapsed ? 'Expand' : 'Collapse') + expect(panel[:class]).send(is_collapsed ? 'not_to' : 'to', include('expanded')) + end +end |