diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-07-05 06:32:05 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-05 06:32:05 +0000 |
commit | 3db2f327594e134729a0ca2f48a748bb28ab7d6c (patch) | |
tree | 661033b988897aaf506c0deaf457c2002e17d51b /spec/features/triggers_spec.rb | |
parent | baab4cddb091c0aa9649fecc340b8b343747ba83 (diff) | |
download | gitlab-ce-3db2f327594e134729a0ca2f48a748bb28ab7d6c.tar.gz |
Enable Capybara/FeatureMethods cop
Diffstat (limited to 'spec/features/triggers_spec.rb')
-rw-r--r-- | spec/features/triggers_spec.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb index 6be2606fd0d..36dafccd186 100644 --- a/spec/features/triggers_spec.rb +++ b/spec/features/triggers_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Triggers', :js do +describe 'Triggers', :js do let(:trigger_title) { 'trigger desc' } let(:user) { create(:user) } let(:user2) { create(:user) } @@ -18,7 +18,7 @@ feature 'Triggers', :js do end describe 'create trigger workflow' do - scenario 'prevents adding new trigger with no description' do + it 'prevents adding new trigger with no description' do fill_in 'trigger_description', with: '' click_button 'Add trigger' @@ -26,7 +26,7 @@ feature 'Triggers', :js do expect(page.find('form.gl-show-field-errors .gl-field-error')).to be_visible end - scenario 'adds new trigger with description' do + it 'adds new trigger with description' do fill_in 'trigger_description', with: 'trigger desc' click_button 'Add trigger' @@ -40,7 +40,7 @@ feature 'Triggers', :js do describe 'edit trigger workflow' do let(:new_trigger_title) { 'new trigger' } - scenario 'click on edit trigger opens edit trigger page' do + it 'click on edit trigger opens edit trigger page' do create(:ci_trigger, owner: user, project: @project, description: trigger_title) visit project_settings_ci_cd_path(@project) @@ -49,7 +49,7 @@ feature 'Triggers', :js do expect(page.find('#trigger_description').value).to have_content 'trigger desc' end - scenario 'edit trigger and save' do + it 'edit trigger and save' do create(:ci_trigger, owner: user, project: @project, description: trigger_title) visit project_settings_ci_cd_path(@project) @@ -64,7 +64,7 @@ feature 'Triggers', :js do expect(page.find('.triggers-list .trigger-owner')).to have_content user.name end - scenario 'edit "legacy" trigger and save' do + it 'edit "legacy" trigger and save' do # Create new trigger without owner association, i.e. Legacy trigger create(:ci_trigger, owner: nil, project: @project) visit project_settings_ci_cd_path(@project) @@ -87,12 +87,12 @@ feature 'Triggers', :js do visit project_settings_ci_cd_path(@project) end - scenario 'button "Take ownership" has correct alert' do + it 'button "Take ownership" has correct alert' do expected_alert = 'By taking ownership you will bind this trigger to your user account. With this the trigger will have access to all your projects as if it was you. Are you sure?' expect(page.find('a.btn-trigger-take-ownership')['data-confirm']).to eq expected_alert end - scenario 'take trigger ownership' do + it 'take trigger ownership' do # See if "Take ownership" on trigger works post trigger creation page.accept_confirm do first(:link, "Take ownership").send_keys(:return) @@ -110,12 +110,12 @@ feature 'Triggers', :js do visit project_settings_ci_cd_path(@project) end - scenario 'button "Revoke" has correct alert' do + it 'button "Revoke" has correct alert' do expected_alert = 'By revoking a trigger you will break any processes making use of it. Are you sure?' expect(page.find('a.btn-trigger-revoke')['data-confirm']).to eq expected_alert end - scenario 'revoke trigger' do + it 'revoke trigger' do # See if "Revoke" on trigger works post trigger creation page.accept_confirm do find('a.btn-trigger-revoke').send_keys(:return) @@ -127,11 +127,11 @@ feature 'Triggers', :js do end describe 'show triggers workflow' do - scenario 'contains trigger description placeholder' do + it 'contains trigger description placeholder' do expect(page.find('#trigger_description')['placeholder']).to eq 'Trigger description' end - scenario 'show "legacy" badge for legacy trigger' do + it 'show "legacy" badge for legacy trigger' do create(:ci_trigger, owner: nil, project: @project) visit project_settings_ci_cd_path(@project) @@ -140,7 +140,7 @@ feature 'Triggers', :js do expect(page.find('.triggers-list')).to have_selector('a[title="Edit"]') end - scenario 'show "invalid" badge for trigger with owner having insufficient permissions' do + it 'show "invalid" badge for trigger with owner having insufficient permissions' do create(:ci_trigger, owner: guest_user, project: @project, description: trigger_title) visit project_settings_ci_cd_path(@project) @@ -149,7 +149,7 @@ feature 'Triggers', :js do expect(page.find('.triggers-list')).not_to have_selector('a[title="Edit"]') end - scenario 'do not show "Edit" or full token for not owned trigger' do + it 'do not show "Edit" or full token for not owned trigger' do # Create trigger with user different from current_user create(:ci_trigger, owner: user2, project: @project, description: trigger_title) visit project_settings_ci_cd_path(@project) @@ -163,7 +163,7 @@ feature 'Triggers', :js do expect(page.find('.triggers-list')).not_to have_selector('a[title="Edit"]') end - scenario 'show "Edit" and full token for owned trigger' do + it 'show "Edit" and full token for owned trigger' do create(:ci_trigger, owner: user, project: @project, description: trigger_title) visit project_settings_ci_cd_path(@project) |