Commit bf09988e authored by Thong Kuah's avatar Thong Kuah

Autocorrect ee/spec with RSpec/ExampleWording cop

- rewords examples starting with 'should'
- rewords examples starting with 'it'
parent dd7ebf75
...@@ -10,7 +10,7 @@ describe Dashboard::ProjectsController do ...@@ -10,7 +10,7 @@ describe Dashboard::ProjectsController do
describe '#index' do describe '#index' do
subject { get :index } subject { get :index }
it 'it works when the external authorization service is enabled' do it 'works when the external authorization service is enabled' do
enable_external_authorization_service_check enable_external_authorization_service_check
get :index get :index
......
...@@ -150,7 +150,7 @@ describe GroupsController do ...@@ -150,7 +150,7 @@ describe GroupsController do
end end
context 'with group view set as default' do context 'with group view set as default' do
it 'should render the expected template' do it 'renders the expected template' do
expect(subject).to render_template('groups/show') expect(subject).to render_template('groups/show')
end end
end end
...@@ -159,7 +159,7 @@ describe GroupsController do ...@@ -159,7 +159,7 @@ describe GroupsController do
let(:user) { create(:user, group_view: :security_dashboard) } let(:user) { create(:user, group_view: :security_dashboard) }
context 'in HTML format' do context 'in HTML format' do
it 'should redirect to the security dashboard' do it 'redirects to the security dashboard' do
expect(subject).to redirect_to(group_security_dashboard_url(group)) expect(subject).to redirect_to(group_security_dashboard_url(group))
end end
end end
...@@ -167,7 +167,7 @@ describe GroupsController do ...@@ -167,7 +167,7 @@ describe GroupsController do
context 'in Atom format' do context 'in Atom format' do
let(:format) { :atom } let(:format) { :atom }
it 'should not redirect to the security dashboard' do it 'does not redirect to the security dashboard' do
expect(subject).to render_template('groups/show') expect(subject).to render_template('groups/show')
end end
end end
...@@ -177,7 +177,7 @@ describe GroupsController do ...@@ -177,7 +177,7 @@ describe GroupsController do
stub_feature_flags(group_overview_security_dashboard: false) stub_feature_flags(group_overview_security_dashboard: false)
end end
it 'should render the expected template' do it 'renders the expected template' do
expect(subject).to render_template('groups/show') expect(subject).to render_template('groups/show')
end end
end end
...@@ -223,7 +223,7 @@ describe GroupsController do ...@@ -223,7 +223,7 @@ describe GroupsController do
context 'with group view set to security dashboard' do context 'with group view set to security dashboard' do
let(:user) { create(:user, group_view: :security_dashboard) } let(:user) { create(:user, group_view: :security_dashboard) }
it 'should not redirect to the security dashboard' do it 'does not redirect to the security dashboard' do
expect(subject).not_to redirect_to(group_security_dashboard_url(group)) expect(subject).not_to redirect_to(group_security_dashboard_url(group))
end end
...@@ -232,7 +232,7 @@ describe GroupsController do ...@@ -232,7 +232,7 @@ describe GroupsController do
stub_feature_flags(group_overview_security_dashboard: false) stub_feature_flags(group_overview_security_dashboard: false)
end end
it 'should render the expected template' do it 'renders the expected template' do
expect(subject).to render_template('groups/show') expect(subject).to render_template('groups/show')
end end
end end
......
...@@ -142,7 +142,7 @@ describe Projects::EnvironmentsController do ...@@ -142,7 +142,7 @@ describe Projects::EnvironmentsController do
get :terminal, params: environment_params get :terminal, params: environment_params
end end
it 'should response with access denied' do it 'responses with access denied' do
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -154,14 +154,14 @@ describe Projects::EnvironmentsController do ...@@ -154,14 +154,14 @@ describe Projects::EnvironmentsController do
get :terminal, params: environment_params get :terminal, params: environment_params
end end
it 'should be successful' do it 'is successful' do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
context 'when environment is not protected' do context 'when environment is not protected' do
it 'should be successful' do it 'is successful' do
get :terminal, params: environment_params get :terminal, params: environment_params
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
......
...@@ -11,7 +11,7 @@ describe Projects::ImportsController do ...@@ -11,7 +11,7 @@ describe Projects::ImportsController do
context 'POST #create' do context 'POST #create' do
context 'mirror user is not the current user' do context 'mirror user is not the current user' do
it 'should only assign the current user' do it 'onlies assign the current user' do
allow_any_instance_of(EE::Project).to receive(:add_import_job) allow_any_instance_of(EE::Project).to receive(:add_import_job)
new_user = create(:user) new_user = create(:user)
......
...@@ -31,19 +31,19 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -31,19 +31,19 @@ describe Projects::ProtectedEnvironmentsController do
end end
context 'with valid params' do context 'with valid params' do
it 'should create a new ProtectedEnvironment' do it 'creates a new ProtectedEnvironment' do
expect do expect do
subject subject
end.to change(ProtectedEnvironment, :count).by(1) end.to change(ProtectedEnvironment, :count).by(1)
end end
it 'should set a flash' do it 'sets a flash' do
subject subject
expect(controller).to set_flash[:notice].to(/environment has been protected/) expect(controller).to set_flash[:notice].to(/environment has been protected/)
end end
it 'should redirect to CI/CD settings' do it 'redirects to CI/CD settings' do
subject subject
expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings') expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings')
...@@ -57,13 +57,13 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -57,13 +57,13 @@ describe Projects::ProtectedEnvironmentsController do
deploy_access_levels_attributes: [{ access_level: maintainer_access }]) deploy_access_levels_attributes: [{ access_level: maintainer_access }])
end end
it 'should not create a new ProtectedEnvironment' do it 'does not create a new ProtectedEnvironment' do
expect do expect do
subject subject
end.not_to change(ProtectedEnvironment, :count) end.not_to change(ProtectedEnvironment, :count)
end end
it 'should redirect to CI/CD settings' do it 'redirects to CI/CD settings' do
subject subject
expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings') expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings')
...@@ -76,7 +76,7 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -76,7 +76,7 @@ describe Projects::ProtectedEnvironmentsController do
project.add_developer(current_user) project.add_developer(current_user)
end end
it 'should render 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(404)
...@@ -114,15 +114,15 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -114,15 +114,15 @@ describe Projects::ProtectedEnvironmentsController do
subject subject
end end
it 'should find the requested protected environment' do it 'finds the requested protected environment' do
expect(assigns(:protected_environment)).to eq(protected_environment) expect(assigns(:protected_environment)).to eq(protected_environment)
end end
it 'should update the protected environment' do it 'updates the protected environment' do
expect(protected_environment.deploy_access_levels.count).to eq(2) expect(protected_environment.deploy_access_levels.count).to eq(2)
end end
it 'should be success' do it 'is success' do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -134,7 +134,7 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -134,7 +134,7 @@ describe Projects::ProtectedEnvironmentsController do
subject subject
end end
it 'should not be success' do it 'is not success' do
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -157,19 +157,19 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -157,19 +157,19 @@ describe Projects::ProtectedEnvironmentsController do
project.add_maintainer(current_user) project.add_maintainer(current_user)
end end
it 'should find the requested protected environment' do it 'finds the requested protected environment' do
subject subject
expect(assigns(:protected_environment)).to eq(protected_environment) expect(assigns(:protected_environment)).to eq(protected_environment)
end end
it 'should delete the requested protected environment' do it 'deletes the requested protected environment' do
expect do expect do
subject subject
end.to change { ProtectedEnvironment.count }.from(1).to(0) end.to change { ProtectedEnvironment.count }.from(1).to(0)
end end
it 'should redirect to CI/CD settings' do it 'redirects to CI/CD settings' do
subject subject
expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings') expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings')
...@@ -181,7 +181,7 @@ describe Projects::ProtectedEnvironmentsController do ...@@ -181,7 +181,7 @@ describe Projects::ProtectedEnvironmentsController do
project.add_developer(current_user) project.add_developer(current_user)
end end
it 'should not be success' do it 'is not success' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(404)
......
...@@ -13,7 +13,7 @@ describe 'CI shared runner settings' do ...@@ -13,7 +13,7 @@ describe 'CI shared runner settings' do
end end
context 'without global shared runners quota' do context 'without global shared runners quota' do
it 'should display ratio with global quota' do it 'displays ratio with global quota' do
visit_admin_group_path visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited") expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
expect(page).to have_selector('.shared_runners_limit_disabled') expect(page).to have_selector('.shared_runners_limit_disabled')
...@@ -25,20 +25,20 @@ describe 'CI shared runner settings' do ...@@ -25,20 +25,20 @@ describe 'CI shared runner settings' do
set_admin_shared_runners_minutes 500 set_admin_shared_runners_minutes 500
end end
it 'should display ratio with global quota' do it 'displays ratio with global quota' do
visit_admin_group_path visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / 500") expect(page).to have_content("Pipeline minutes quota: 400 / 500")
expect(page).to have_selector('.shared_runners_limit_under_quota') expect(page).to have_selector('.shared_runners_limit_under_quota')
end end
it 'should display new ratio with overridden group quota' do it 'displays new ratio with overridden group quota' do
set_group_shared_runners_minutes 300 set_group_shared_runners_minutes 300
visit_admin_group_path visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / 300") expect(page).to have_content("Pipeline minutes quota: 400 / 300")
expect(page).to have_selector('.shared_runners_limit_over_quota') expect(page).to have_selector('.shared_runners_limit_over_quota')
end end
it 'should display unlimited ratio with overridden group quota' do it 'displays unlimited ratio with overridden group quota' do
set_group_shared_runners_minutes 0 set_group_shared_runners_minutes 0
visit_admin_group_path visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited") expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
......
...@@ -15,12 +15,12 @@ describe 'CI shared runner limits' do ...@@ -15,12 +15,12 @@ describe 'CI shared runner limits' do
end end
context 'without limit' do context 'without limit' do
it 'it does not display a warning message on project homepage' do it 'does not display a warning message on project homepage' do
visit_project_home visit_project_home
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
it 'it does not display a warning message on pipelines page' do it 'does not display a warning message on pipelines page' do
visit_project_pipelines visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
...@@ -30,12 +30,12 @@ describe 'CI shared runner limits' do ...@@ -30,12 +30,12 @@ describe 'CI shared runner limits' do
context 'when limit is exceeded' do context 'when limit is exceeded' do
let(:group) { create(:group, :with_used_build_minutes_limit) } let(:group) { create(:group, :with_used_build_minutes_limit) }
it 'it displays a warning message on project homepage' do it 'displays a warning message on project homepage' do
visit_project_home visit_project_home
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.") expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end end
it 'it displays a warning message on pipelines page' do it 'displays a warning message on pipelines page' do
visit_project_pipelines visit_project_pipelines
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.") expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end end
...@@ -44,12 +44,12 @@ describe 'CI shared runner limits' do ...@@ -44,12 +44,12 @@ describe 'CI shared runner limits' do
context 'when limit not yet exceeded' do context 'when limit not yet exceeded' do
let(:group) { create(:group, :with_not_used_build_minutes_limit) } let(:group) { create(:group, :with_not_used_build_minutes_limit) }
it 'it does not display a warning message on project homepage' do it 'does not display a warning message on project homepage' do
visit_project_home visit_project_home
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
it 'it does not display a warning message on pipelines page' do it 'does not display a warning message on pipelines page' do
visit_project_pipelines visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
...@@ -58,12 +58,12 @@ describe 'CI shared runner limits' do ...@@ -58,12 +58,12 @@ describe 'CI shared runner limits' do
context 'when minutes are not yet set' do context 'when minutes are not yet set' do
let(:group) { create(:group, :with_build_minutes_limit) } let(:group) { create(:group, :with_build_minutes_limit) }
it 'it does not display a warning message on project homepage' do it 'does not display a warning message on project homepage' do
visit_project_home visit_project_home
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
it 'it does not display a warning message on pipelines page' do it 'does not display a warning message on pipelines page' do
visit_project_pipelines visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
...@@ -75,12 +75,12 @@ describe 'CI shared runner limits' do ...@@ -75,12 +75,12 @@ describe 'CI shared runner limits' do
let(:group) { create(:group, :with_used_build_minutes_limit) } let(:group) { create(:group, :with_used_build_minutes_limit) }
context 'when limit is defined and limit is exceeded' do context 'when limit is defined and limit is exceeded' do
it 'it does not display a warning message on project homepage' do it 'does not display a warning message on project homepage' do
visit_project_home visit_project_home
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
it 'it does not display a warning message on pipelines page' do it 'does not display a warning message on pipelines page' do
visit_project_pipelines visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
......
...@@ -46,7 +46,7 @@ describe 'Dropdown weight', :js do ...@@ -46,7 +46,7 @@ describe 'Dropdown weight', :js do
expect(page).to have_css(js_dropdown_weight, visible: false) expect(page).to have_css(js_dropdown_weight, visible: false)
end end
it 'should load all the weights when opened' do it 'loads all the weights when opened' do
send_keys_to_filtered_search('weight:') send_keys_to_filtered_search('weight:')
expect(page.all('#js-dropdown-weight .filter-dropdown .filter-dropdown-item').size).to eq(21) expect(page.all('#js-dropdown-weight .filter-dropdown .filter-dropdown-item').size).to eq(21)
......
...@@ -50,7 +50,7 @@ describe 'New/edit issue', :js do ...@@ -50,7 +50,7 @@ describe 'New/edit issue', :js do
wait_for_requests wait_for_requests
end end
it 'should display selected users even if they are not part of the original API call' do it 'displays selected users even if they are not part of the original API call' do
find('.dropdown-input-field').native.send_keys user2.name find('.dropdown-input-field').native.send_keys user2.name
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
......
...@@ -11,7 +11,7 @@ describe 'Issues sub nav EE' do ...@@ -11,7 +11,7 @@ describe 'Issues sub nav EE' do
visit project_issues_path(project) visit project_issues_path(project)
end end
it 'should have a `Boards` item' do it 'has a `Boards` item' do
expect(find('.nav-sidebar')).to have_content 'Boards' expect(find('.nav-sidebar')).to have_content 'Boards'
end end
end end
...@@ -35,7 +35,7 @@ describe 'Pipeline', :js do ...@@ -35,7 +35,7 @@ describe 'Pipeline', :js do
end end
context 'expands the upstream pipeline on click' do context 'expands the upstream pipeline on click' do
it 'should expand the upstream on click' do it 'expands the upstream on click' do
subject subject
page.find(".js-pipeline-expand-#{upstream_pipeline.id}").click page.find(".js-pipeline-expand-#{upstream_pipeline.id}").click
...@@ -43,7 +43,7 @@ describe 'Pipeline', :js do ...@@ -43,7 +43,7 @@ describe 'Pipeline', :js do
expect(page).to have_selector(".js-upstream-pipeline-#{upstream_pipeline.id}") expect(page).to have_selector(".js-upstream-pipeline-#{upstream_pipeline.id}")
end end
it 'should close the expanded upstream on click' do it 'closes the expanded upstream on click' do
subject subject
# open # open
...@@ -65,7 +65,7 @@ describe 'Pipeline', :js do ...@@ -65,7 +65,7 @@ describe 'Pipeline', :js do
end end
context 'expands the downstream pipeline on click' do context 'expands the downstream pipeline on click' do
it 'should expand the downstream on click' do it 'expands the downstream on click' do
subject subject
page.find(".js-pipeline-expand-#{downstream_pipeline.id}").click page.find(".js-pipeline-expand-#{downstream_pipeline.id}").click
...@@ -73,7 +73,7 @@ describe 'Pipeline', :js do ...@@ -73,7 +73,7 @@ describe 'Pipeline', :js do
expect(page).to have_selector(".js-downstream-pipeline-#{downstream_pipeline.id}") expect(page).to have_selector(".js-downstream-pipeline-#{downstream_pipeline.id}")
end end
it 'should close the expanded downstream on click' do it 'closes the expanded downstream on click' do
subject subject
# open # open
......
...@@ -15,7 +15,7 @@ describe 'Promotions', :js do ...@@ -15,7 +15,7 @@ describe 'Promotions', :js do
project.add_maintainer(user) project.add_maintainer(user)
end end
it 'should show no promotion at all' do it 'shows no promotion at all' do
sign_in(user) sign_in(user)
visit edit_project_path(project) visit edit_project_path(project)
...@@ -31,14 +31,14 @@ describe 'Promotions', :js do ...@@ -31,14 +31,14 @@ describe 'Promotions', :js do
project.add_maintainer(user) project.add_maintainer(user)
end end
it 'should have the contact admin line' do it 'has the contact admin line' do
sign_in(user) sign_in(user)
visit edit_project_path(project) visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Contact your Administrator to upgrade your license.' expect(find('#promote_service_desk')).to have_content 'Contact your Administrator to upgrade your license.'
end end
it 'should have the start trial button' do it 'has the start trial button' do
sign_in(admin) sign_in(admin)
visit edit_project_path(project) visit edit_project_path(project)
...@@ -59,13 +59,13 @@ describe 'Promotions', :js do ...@@ -59,13 +59,13 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should have the Upgrade your plan button' do it 'has the Upgrade your plan button' do
visit edit_project_path(project) visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Upgrade your plan' expect(find('#promote_service_desk')).to have_content 'Upgrade your plan'
end end
it 'should have the contact owner line' do it 'has the contact owner line' do
visit edit_project_path(otherproject) visit edit_project_path(otherproject)
expect(find('#promote_service_desk')).to have_content 'Contact owner' expect(find('#promote_service_desk')).to have_content 'Contact owner'
...@@ -82,7 +82,7 @@ describe 'Promotions', :js do ...@@ -82,7 +82,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear in project edit page' do it 'appears in project edit page' do
visit edit_project_path(project) visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Improve customer support with GitLab Service Desk.' expect(find('#promote_service_desk')).to have_content 'Improve customer support with GitLab Service Desk.'
...@@ -112,7 +112,7 @@ describe 'Promotions', :js do ...@@ -112,7 +112,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear in project edit page' do it 'appears in project edit page' do
visit edit_project_path(project) visit edit_project_path(project)
expect(find('#promote_mr_features')).to have_content 'Improve Merge Requests' expect(find('#promote_mr_features')).to have_content 'Improve Merge Requests'
...@@ -142,7 +142,7 @@ describe 'Promotions', :js do ...@@ -142,7 +142,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear in repository settings page' do it 'appears in repository settings page' do
visit project_settings_repository_path(project) visit project_settings_repository_path(project)
expect(find('#promote_repository_features')).to have_content 'Improve repositories with GitLab Enterprise Edition' expect(find('#promote_repository_features')).to have_content 'Improve repositories with GitLab Enterprise Edition'
...@@ -170,7 +170,7 @@ describe 'Promotions', :js do ...@@ -170,7 +170,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear in milestone page' do it 'appears in milestone page' do
visit project_milestone_path(project, milestone) visit project_milestone_path(project, milestone)
expect(find('#promote_burndown_charts')).to have_content "Upgrade your plan to improve milestones with Burndown Charts." expect(find('#promote_burndown_charts')).to have_content "Upgrade your plan to improve milestones with Burndown Charts."
...@@ -198,7 +198,7 @@ describe 'Promotions', :js do ...@@ -198,7 +198,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear in milestone page' do it 'appears in milestone page' do
visit project_boards_path(project) visit project_boards_path(project)
expect(find('.board-promotion-state')).to have_content "Upgrade your plan to improve Issue boards" expect(find('.board-promotion-state')).to have_content "Upgrade your plan to improve Issue boards"
...@@ -226,7 +226,7 @@ describe 'Promotions', :js do ...@@ -226,7 +226,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on export modal' do it 'appears on export modal' do
visit project_issues_path(project) visit project_issues_path(project)
click_on 'Export as CSV' click_on 'Export as CSV'
...@@ -237,7 +237,7 @@ describe 'Promotions', :js do ...@@ -237,7 +237,7 @@ describe 'Promotions', :js do
describe 'for epics in issues sidebar', :js do describe 'for epics in issues sidebar', :js do
shared_examples 'Epics promotion' do shared_examples 'Epics promotion' do
it 'should appear on the page' do it 'appears on the page' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -246,7 +246,7 @@ describe 'Promotions', :js do ...@@ -246,7 +246,7 @@ describe 'Promotions', :js do
expect(find('.promotion-issue-sidebar-message')).to have_content 'Epics let you manage your portfolio of projects more efficiently' expect(find('.promotion-issue-sidebar-message')).to have_content 'Epics let you manage your portfolio of projects more efficiently'
end end
it 'should be removed after dismissal' do it 'is removed after dismissal' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -256,7 +256,7 @@ describe 'Promotions', :js do ...@@ -256,7 +256,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.promotion-issue-sidebar-message') expect(page).not_to have_selector('.promotion-issue-sidebar-message')
end end
it 'should not appear on page after dismissal and reload' do it 'does not appear on page after dismissal and reload' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -267,7 +267,7 @@ describe 'Promotions', :js do ...@@ -267,7 +267,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.js-epics-sidebar-callout') expect(page).not_to have_selector('.js-epics-sidebar-callout')
end end
it 'should close dialog when clicking on X, but not dismiss it' do it 'closes dialog when clicking on X, but not dismiss it' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -313,7 +313,7 @@ describe 'Promotions', :js do ...@@ -313,7 +313,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on the page', :js do it 'appears on the page', :js do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -322,7 +322,7 @@ describe 'Promotions', :js do ...@@ -322,7 +322,7 @@ describe 'Promotions', :js do
expect(find('.promotion-issue-sidebar-message')).to have_content 'Improve issues management with Issue weight and GitLab Enterprise Edition' expect(find('.promotion-issue-sidebar-message')).to have_content 'Improve issues management with Issue weight and GitLab Enterprise Edition'
end end
it 'should be removed after dismissal' do it 'is removed after dismissal' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -332,7 +332,7 @@ describe 'Promotions', :js do ...@@ -332,7 +332,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.js-weight-sidebar-callout') expect(page).not_to have_selector('.js-weight-sidebar-callout')
end end
it 'should not appear on page after dismissal and reload' do it 'does not appear on page after dismissal and reload' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -343,7 +343,7 @@ describe 'Promotions', :js do ...@@ -343,7 +343,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.js-weight-sidebar-callout') expect(page).not_to have_selector('.js-weight-sidebar-callout')
end end
it 'should close dialog when clicking on X, but not dismiss it' do it 'closes dialog when clicking on X, but not dismiss it' do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
...@@ -364,7 +364,7 @@ describe 'Promotions', :js do ...@@ -364,7 +364,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on the page', :js do it 'appears on the page', :js do
visit new_project_issue_path(project) visit new_project_issue_path(project)
wait_for_requests wait_for_requests
...@@ -383,7 +383,7 @@ describe 'Promotions', :js do ...@@ -383,7 +383,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on the page' do it 'appears on the page' do
visit project_audit_events_path(project) visit project_audit_events_path(project)
expect(find('.user-callout-copy')).to have_content 'Track your project with Audit Events' expect(find('.user-callout-copy')).to have_content 'Track your project with Audit Events'
...@@ -399,7 +399,7 @@ describe 'Promotions', :js do ...@@ -399,7 +399,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on the page' do it 'appears on the page' do
visit group_analytics_path(group) visit group_analytics_path(group)
expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution Analytics.' expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution Analytics.'
...@@ -415,7 +415,7 @@ describe 'Promotions', :js do ...@@ -415,7 +415,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on the page' do it 'appears on the page' do
visit group_hooks_path(group) visit group_hooks_path(group)
expect(find('.user-callout-copy')).to have_content 'Add Group Webhooks' expect(find('.user-callout-copy')).to have_content 'Add Group Webhooks'
...@@ -430,7 +430,7 @@ describe 'Promotions', :js do ...@@ -430,7 +430,7 @@ describe 'Promotions', :js do
sign_in(user) sign_in(user)
end end
it 'should appear on seearch page' do it 'appears on seearch page' do
visit search_path visit search_path
fill_in 'search', with: 'chosen' fill_in 'search', with: 'chosen'
......
...@@ -12,7 +12,7 @@ describe EE::EmailsHelper do ...@@ -12,7 +12,7 @@ describe EE::EmailsHelper do
end end
with_them do with_them do
it 'should return the expected title' do it 'returns the expected title' do
title = helper.action_title(path) title = helper.action_title(path)
expect(title).to eq(result) expect(title).to eq(result)
end end
......
...@@ -126,7 +126,7 @@ describe EpicsHelper do ...@@ -126,7 +126,7 @@ describe EpicsHelper do
end end
describe '#epic_endpoint_query_params' do describe '#epic_endpoint_query_params' do
it 'it includes epic specific options in JSON format' do it 'includes epic specific options in JSON format' do
opts = epic_endpoint_query_params({}) opts = epic_endpoint_query_params({})
expected = "{\"only_group_labels\":true,\"include_ancestor_groups\":true,\"include_descendant_groups\":true}" expected = "{\"only_group_labels\":true,\"include_ancestor_groups\":true,\"include_descendant_groups\":true}"
......
...@@ -67,7 +67,7 @@ describe EE::Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache do ...@@ -67,7 +67,7 @@ describe EE::Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache do
expect(access.load!).to eq(access) expect(access.load!).to eq(access)
end end
it 'it stores the result in redis' do it 'stores the result in redis' do
Timecop.freeze do Timecop.freeze do
fake_cache = double fake_cache = double
expect(fake_cache).to receive(:store).with(true, nil, Time.now) expect(fake_cache).to receive(:store).with(true, nil, Time.now)
...@@ -98,7 +98,7 @@ describe EE::Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache do ...@@ -98,7 +98,7 @@ describe EE::Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache do
expect(access.loaded_at).not_to be_nil expect(access.loaded_at).not_to be_nil
end end
it 'it does not store the result in redis' do it 'does not store the result in redis' do
fake_cache = double fake_cache = double
expect(fake_cache).not_to receive(:store) expect(fake_cache).not_to receive(:store)
allow(access).to receive(:cache).and_return(fake_cache) allow(access).to receive(:cache).and_return(fake_cache)
......
...@@ -140,7 +140,7 @@ describe Gitlab::Database::LoadBalancing::ConnectionProxy do ...@@ -140,7 +140,7 @@ describe Gitlab::Database::LoadBalancing::ConnectionProxy do
.and_return(session) .and_return(session)
end end
it 'it uses but does not stick to the primary when sticking is disabled' do it 'uses but does not stick to the primary when sticking is disabled' do
expect(proxy.load_balancer).to receive(:read_write).and_yield(connection) expect(proxy.load_balancer).to receive(:read_write).and_yield(connection)
expect(connection).to receive(:foo).with('foo') expect(connection).to receive(:foo).with('foo')
expect(session).not_to receive(:write!) expect(session).not_to receive(:write!)
......
...@@ -39,7 +39,7 @@ describe Burndown do ...@@ -39,7 +39,7 @@ describe Burndown do
expect(subject).to eq([].to_json) expect(subject).to eq([].to_json)
end end
it "it counts until today if milestone due date > Date.today" do it "counts until today if milestone due date > Date.today" do
Timecop.travel(milestone.due_date - 1.day) do Timecop.travel(milestone.due_date - 1.day) do
expect(JSON.parse(subject).last[0]).to eq(Time.now.strftime("%Y-%m-%d")) expect(JSON.parse(subject).last[0]).to eq(Time.now.strftime("%Y-%m-%d"))
end end
......
...@@ -231,7 +231,7 @@ describe EE::DeploymentPlatform do ...@@ -231,7 +231,7 @@ describe EE::DeploymentPlatform do
stub_licensed_features(multiple_clusters: true) stub_licensed_features(multiple_clusters: true)
end end
it 'should return the appropriate cluster' do it 'returns the appropriate cluster' do
expect(project.deployment_platform(environment: environment_1)).to eq(cluster_1.platform_kubernetes) expect(project.deployment_platform(environment: environment_1)).to eq(cluster_1.platform_kubernetes)
expect(project.deployment_platform(environment: environment_2)).to eq(cluster_2.platform_kubernetes) expect(project.deployment_platform(environment: environment_2)).to eq(cluster_2.platform_kubernetes)
end end
......
...@@ -2186,7 +2186,7 @@ describe Project do ...@@ -2186,7 +2186,7 @@ describe Project do
end end
describe '#create_import_state' do describe '#create_import_state' do
it 'it is called after save' do it 'is called after save' do
project = create(:project) project = create(:project)
expect(project).to receive(:create_import_state) expect(project).to receive(:create_import_state)
......
...@@ -53,7 +53,7 @@ describe PrometheusAlertEvent do ...@@ -53,7 +53,7 @@ describe PrometheusAlertEvent do
context 'when status is none' do context 'when status is none' do
subject { build(:prometheus_alert_event, :none) } subject { build(:prometheus_alert_event, :none) }
it 'it fires an event' do it 'fires an event' do
result = subject.fire(started_at) result = subject.fire(started_at)
expect(result).to eq(true) expect(result).to eq(true)
...@@ -79,7 +79,7 @@ describe PrometheusAlertEvent do ...@@ -79,7 +79,7 @@ describe PrometheusAlertEvent do
context 'when firing' do context 'when firing' do
subject { build(:prometheus_alert_event) } subject { build(:prometheus_alert_event) }
it 'it resolves an event' do it 'resolves an event' do
result = subject.resolve!(ended_at) result = subject.resolve!(ended_at)
expect(result).to eq(true) expect(result).to eq(true)
......
...@@ -42,13 +42,13 @@ describe ProtectedEnvironment do ...@@ -42,13 +42,13 @@ describe ProtectedEnvironment do
create_deploy_access_level(group: group) create_deploy_access_level(group: group)
end end
it 'should allow members of the group' do it 'allows members of the group' do
group.add_developer(user) group.add_developer(user)
expect(subject).to be_truthy expect(subject).to be_truthy
end end
it 'should reject non-members of the group' do it 'rejects non-members of the group' do
expect(subject).to be_falsy expect(subject).to be_falsy
end end
end end
...@@ -58,13 +58,13 @@ describe ProtectedEnvironment do ...@@ -58,13 +58,13 @@ describe ProtectedEnvironment do
create_deploy_access_level(access_level: Gitlab::Access::MAINTAINER) create_deploy_access_level(access_level: Gitlab::Access::MAINTAINER)
end end
it 'should allow maintainers' do it 'allows maintainers' do
project.add_maintainer(user) project.add_maintainer(user)
expect(subject).to be_truthy expect(subject).to be_truthy
end end
it 'should reject developers' do it 'rejects developers' do
project.add_developer(user) project.add_developer(user)
expect(subject).to be_falsy expect(subject).to be_falsy
...@@ -76,13 +76,13 @@ describe ProtectedEnvironment do ...@@ -76,13 +76,13 @@ describe ProtectedEnvironment do
create_deploy_access_level(access_level: Gitlab::Access::DEVELOPER) create_deploy_access_level(access_level: Gitlab::Access::DEVELOPER)
end end
it 'should allow maintainers' do it 'allows maintainers' do
project.add_maintainer(user) project.add_maintainer(user)
expect(subject).to be_truthy expect(subject).to be_truthy
end end
it 'should allow developers' do it 'allows developers' do
project.add_developer(user) project.add_developer(user)
expect(subject).to be_truthy expect(subject).to be_truthy
......
...@@ -57,7 +57,7 @@ describe API::ProjectClusters do ...@@ -57,7 +57,7 @@ describe API::ProjectClusters do
end end
context 'when user sets specific environment scope' do context 'when user sets specific environment scope' do
it 'should create a cluster with that specific environment' do it 'creates a cluster with that specific environment' do
post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params
expect(json_response['environment_scope']).to eq('production/*') expect(json_response['environment_scope']).to eq('production/*')
...@@ -72,7 +72,7 @@ describe API::ProjectClusters do ...@@ -72,7 +72,7 @@ describe API::ProjectClusters do
} }
end end
it 'should set default environment' do it 'sets default environment' do
post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params
expect(json_response['environment_scope']).to eq('*') expect(json_response['environment_scope']).to eq('*')
...@@ -89,11 +89,11 @@ describe API::ProjectClusters do ...@@ -89,11 +89,11 @@ describe API::ProjectClusters do
post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params
end end
it 'should respond with 201' do it 'responds with 201' do
expect(response).to have_gitlab_http_status(201) expect(response).to have_gitlab_http_status(201)
end end
it 'should allow to associate multiple cluster to project' do it 'allows to associate multiple cluster to project' do
expect(project.reload.clusters.count).to eq(2) expect(project.reload.clusters.count).to eq(2)
end end
end end
...@@ -124,7 +124,7 @@ describe API::ProjectClusters do ...@@ -124,7 +124,7 @@ describe API::ProjectClusters do
projects: [project]) projects: [project])
end end
it 'should update the environment scope' do it 'updates the environment scope' do
expect(cluster.environment_scope).to eq('test/*') expect(cluster.environment_scope).to eq('test/*')
end end
end end
...@@ -135,7 +135,7 @@ describe API::ProjectClusters do ...@@ -135,7 +135,7 @@ describe API::ProjectClusters do
projects: [project]) projects: [project])
end end
it 'should update the environment scope' do it 'updates the environment scope' do
expect(cluster.environment_scope).to eq('test/*') expect(cluster.environment_scope).to eq('test/*')
end end
end end
......
...@@ -13,7 +13,7 @@ describe 'JIRA authorization requests' do ...@@ -13,7 +13,7 @@ describe 'JIRA authorization requests' do
let(:client_id) { application.uid } let(:client_id) { application.uid }
let(:client_secret) { application.secret } let(:client_secret) { application.secret }
it 'should return values similar to a POST to /oauth/token' do it 'returns values similar to a POST to /oauth/token' do
post_data = { post_data = {
client_id: client_id, client_id: client_id,
client_secret: client_secret client_secret: client_secret
......
...@@ -94,7 +94,7 @@ describe MergeRequestWidgetEntity do ...@@ -94,7 +94,7 @@ describe MergeRequestWidgetEntity do
stub_licensed_features(license_management: true) stub_licensed_features(license_management: true)
end end
it 'should not be included, if missing artifacts' do it 'is not included, if missing artifacts' do
expect(subject.as_json).not_to include(:license_management) expect(subject.as_json).not_to include(:license_management)
end end
...@@ -103,7 +103,7 @@ describe MergeRequestWidgetEntity do ...@@ -103,7 +103,7 @@ describe MergeRequestWidgetEntity do
create(:ee_ci_build, :license_management, pipeline: pipeline) create(:ee_ci_build, :license_management, pipeline: pipeline)
end end
it 'should be included' do it 'is included' do
expect(subject.as_json).to include(:license_management) expect(subject.as_json).to include(:license_management)
expect(subject.as_json[:license_management]).to include(:head_path) expect(subject.as_json[:license_management]).to include(:head_path)
expect(subject.as_json[:license_management]).to include(:base_path) expect(subject.as_json[:license_management]).to include(:base_path)
...@@ -118,7 +118,7 @@ describe MergeRequestWidgetEntity do ...@@ -118,7 +118,7 @@ describe MergeRequestWidgetEntity do
stub_licensed_features(license_management: false) stub_licensed_features(license_management: false)
end end
it 'should not be included' do it 'is not included' do
expect(subject.as_json).not_to include(:license_management) expect(subject.as_json).not_to include(:license_management)
end end
end end
...@@ -143,7 +143,7 @@ describe MergeRequestWidgetEntity do ...@@ -143,7 +143,7 @@ describe MergeRequestWidgetEntity do
create(:ee_ci_build, :legacy_license_management, pipeline: pipeline) create(:ee_ci_build, :legacy_license_management, pipeline: pipeline)
end end
it 'should be included, if license manage management features are on' do it 'is included, if license manage management features are on' do
expect(subject.as_json).to include(:license_management) expect(subject.as_json).to include(:license_management)
expect(subject.as_json[:license_management]).to include(:head_path) expect(subject.as_json[:license_management]).to include(:head_path)
expect(subject.as_json[:license_management]).to include(:base_path) expect(subject.as_json[:license_management]).to include(:base_path)
...@@ -160,7 +160,7 @@ describe MergeRequestWidgetEntity do ...@@ -160,7 +160,7 @@ describe MergeRequestWidgetEntity do
create(:ee_ci_build, :legacy_license_management, pipeline: pipeline) create(:ee_ci_build, :legacy_license_management, pipeline: pipeline)
end end
it 'should be a path for target project' do it 'is a path for target project' do
expect(subject.as_json[:license_management][:managed_licenses_path]).to eq(managed_licenses_path) expect(subject.as_json[:license_management][:managed_licenses_path]).to eq(managed_licenses_path)
end end
...@@ -174,7 +174,7 @@ describe MergeRequestWidgetEntity do ...@@ -174,7 +174,7 @@ describe MergeRequestWidgetEntity do
stub_licensed_features(license_management: true) stub_licensed_features(license_management: true)
end end
it 'should be a path for target project' do it 'is a path for target project' do
expect(subject_json[:license_management][:managed_licenses_path]).to eq(managed_licenses_path) expect(subject_json[:license_management][:managed_licenses_path]).to eq(managed_licenses_path)
end end
end end
......
...@@ -34,7 +34,7 @@ describe Ci::ProcessBuildService, '#execute' do ...@@ -34,7 +34,7 @@ describe Ci::ProcessBuildService, '#execute' do
let(:feature_available) { true } let(:feature_available) { true }
context 'when user does not have access to the environment' do context 'when user does not have access to the environment' do
it 'should fail the build' do it 'fails the build' do
subject subject
expect(ci_build.failed?).to be_truthy expect(ci_build.failed?).to be_truthy
......
...@@ -19,7 +19,7 @@ describe Groups::ParticipantsService do ...@@ -19,7 +19,7 @@ describe Groups::ParticipantsService do
end end
describe '#execute' do describe '#execute' do
it 'should add the owner to the list' do it 'adds the owner to the list' do
expect(described_class.new(group, user).execute(epic).first).to eq(user_to_autocompletable(user)) expect(described_class.new(group, user).execute(epic).first).to eq(user_to_autocompletable(user))
end end
end end
...@@ -36,7 +36,7 @@ describe Groups::ParticipantsService do ...@@ -36,7 +36,7 @@ describe Groups::ParticipantsService do
create(:note, author: user, project: nil, noteable: epic, note: @users.map { |u| u.to_reference }.join(' ')) create(:note, author: user, project: nil, noteable: epic, note: @users.map { |u| u.to_reference }.join(' '))
end end
it 'should return all participants' do it 'returns all participants' do
service = described_class.new(group, user) service = described_class.new(group, user)
service.instance_variable_set(:@noteable, epic) service.instance_variable_set(:@noteable, epic)
result = service.participants_in_noteable result = service.participants_in_noteable
...@@ -53,7 +53,7 @@ describe Groups::ParticipantsService do ...@@ -53,7 +53,7 @@ describe Groups::ParticipantsService do
let(:subgroup) { create(:group_with_members, parent: group) } let(:subgroup) { create(:group_with_members, parent: group) }
let(:subproject) { create(:project, group: subgroup) } let(:subproject) { create(:project, group: subgroup) }
it 'should return all members in parent groups, sub-groups, and sub-projects' do it 'returns all members in parent groups, sub-groups, and sub-projects' do
parent_group.add_developer(create(:user)) parent_group.add_developer(create(:user))
subgroup.add_developer(create(:user)) subgroup.add_developer(create(:user))
subproject.add_developer(create(:user)) subproject.add_developer(create(:user))
...@@ -74,12 +74,12 @@ describe Groups::ParticipantsService do ...@@ -74,12 +74,12 @@ describe Groups::ParticipantsService do
describe 'avatar_url' do describe 'avatar_url' do
let(:groups) { described_class.new(group, user).groups } let(:groups) { described_class.new(group, user).groups }
it 'should return an url for the avatar' do it 'returns an url for the avatar' do
expect(groups.size).to eq 1 expect(groups.size).to eq 1
expect(groups.first[:avatar_url]).to eq("/uploads/-/system/group/avatar/#{group.id}/dk.png") expect(groups.first[:avatar_url]).to eq("/uploads/-/system/group/avatar/#{group.id}/dk.png")
end end
it 'should return an url for the avatar with relative url' do it 'returns an url for the avatar with relative url' do
stub_config_setting(relative_url_root: '/gitlab') stub_config_setting(relative_url_root: '/gitlab')
stub_config_setting(url: Settings.send(:build_gitlab_url)) stub_config_setting(url: Settings.send(:build_gitlab_url))
......
...@@ -89,7 +89,7 @@ describe Projects::Prometheus::Alerts::CreateEventsService do ...@@ -89,7 +89,7 @@ describe Projects::Prometheus::Alerts::CreateEventsService do
started_at: started_at) started_at: started_at)
end end
it 'it does not create an additional event' do it 'does not create an additional event' do
expect { service.execute }.not_to change { PrometheusAlertEvent.count } expect { service.execute }.not_to change { PrometheusAlertEvent.count }
end end
...@@ -105,7 +105,7 @@ describe Projects::Prometheus::Alerts::CreateEventsService do ...@@ -105,7 +105,7 @@ describe Projects::Prometheus::Alerts::CreateEventsService do
context 'with duplicate payload' do context 'with duplicate payload' do
let(:alerts_payload) { { 'alerts' => [resolved_event, resolved_event] } } let(:alerts_payload) { { 'alerts' => [resolved_event, resolved_event] } }
it 'it does not create an additional event' do it 'does not create an additional event' do
expect { service.execute }.not_to change { PrometheusAlertEvent.count } expect { service.execute }.not_to change { PrometheusAlertEvent.count }
end end
......
...@@ -16,11 +16,11 @@ describe ProtectedEnvironments::CreateService, '#execute' do ...@@ -16,11 +16,11 @@ describe ProtectedEnvironments::CreateService, '#execute' do
context 'with valid params' do context 'with valid params' do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
it 'should create a record on ProtectedEnvironment' do it 'creates a record on ProtectedEnvironment' do
expect { subject }.to change(ProtectedEnvironment, :count).by(1) expect { subject }.to change(ProtectedEnvironment, :count).by(1)
end end
it 'should create a record on ProtectedEnvironment record' do it 'creates a record on ProtectedEnvironment record' do
expect { subject }.to change(ProtectedEnvironment::DeployAccessLevel, :count).by(1) expect { subject }.to change(ProtectedEnvironment::DeployAccessLevel, :count).by(1)
end end
end end
...@@ -28,7 +28,7 @@ describe ProtectedEnvironments::CreateService, '#execute' do ...@@ -28,7 +28,7 @@ describe ProtectedEnvironments::CreateService, '#execute' do
context 'with invalid params' do context 'with invalid params' do
let(:maintainer_access) { 0 } let(:maintainer_access) { 0 }
it 'should return a non persisted Protected Environment record' do it 'returns a non persisted Protected Environment record' do
expect(subject.persisted?).to be_falsy expect(subject.persisted?).to be_falsy
end end
end end
......
...@@ -12,13 +12,13 @@ describe ProtectedEnvironments::DestroyService, '#execute' do ...@@ -12,13 +12,13 @@ describe ProtectedEnvironments::DestroyService, '#execute' do
context 'when the Protected Environment is deleted' do context 'when the Protected Environment is deleted' do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
it 'should delete the requested ProtectedEnvironment' do it 'deletes the requested ProtectedEnvironment' do
expect do expect do
subject subject
end.to change { ProtectedEnvironment.count }.from(1).to(0) end.to change { ProtectedEnvironment.count }.from(1).to(0)
end end
it 'should delete the related DeployAccessLevel' do it 'deletes the related DeployAccessLevel' do
expect do expect do
subject subject
end.to change { ProtectedEnvironment::DeployAccessLevel.count }.from(1).to(0) end.to change { ProtectedEnvironment::DeployAccessLevel.count }.from(1).to(0)
......
...@@ -37,7 +37,7 @@ describe ProtectedEnvironments::SearchService, '#execute' do ...@@ -37,7 +37,7 @@ describe ProtectedEnvironments::SearchService, '#execute' do
context 'when no match' do context 'when no match' do
let(:environment_name) { 'no_match' } let(:environment_name) { 'no_match' }
it 'should return an empty array' do it 'returns an empty array' do
expect(subject).to eq([]) expect(subject).to eq([])
end end
end end
......
...@@ -26,7 +26,7 @@ describe ProtectedEnvironments::UpdateService, '#execute' do ...@@ -26,7 +26,7 @@ describe ProtectedEnvironments::UpdateService, '#execute' do
context 'with valid params' do context 'with valid params' do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
it 'should change update the deploy access levels' do it 'changes update the deploy access levels' do
expect do expect do
subject subject
end.to change { ProtectedEnvironment::DeployAccessLevel.count }.from(1).to(2) end.to change { ProtectedEnvironment::DeployAccessLevel.count }.from(1).to(2)
...@@ -38,7 +38,7 @@ describe ProtectedEnvironments::UpdateService, '#execute' do ...@@ -38,7 +38,7 @@ describe ProtectedEnvironments::UpdateService, '#execute' do
it { is_expected.to be_falsy } it { is_expected.to be_falsy }
it 'should not update the deploy access levels' do it 'does not update the deploy access levels' do
expect do expect do
subject subject
end.not_to change { ProtectedEnvironment::DeployAccessLevel.count } end.not_to change { ProtectedEnvironment::DeployAccessLevel.count }
......
...@@ -20,7 +20,7 @@ RSpec.shared_examples 'restricts access to protected environments' do |developer ...@@ -20,7 +20,7 @@ RSpec.shared_examples 'restricts access to protected environments' do |developer
end end
context 'when user does not have access to the environment' do context 'when user does not have access to the environment' do
it 'should raise Gitlab::Access::DeniedError' do it 'raises Gitlab::Access::DeniedError' do
expect { service.execute(build) } expect { service.execute(build) }
.to raise_error Gitlab::Access::AccessDeniedError .to raise_error Gitlab::Access::AccessDeniedError
end end
......
...@@ -6,7 +6,7 @@ describe ProjectUpdateRepositoryStorageWorker do ...@@ -6,7 +6,7 @@ describe ProjectUpdateRepositoryStorageWorker do
subject { described_class.new } subject { described_class.new }
describe "#perform" do describe "#perform" do
it "should call the update repository storage service" do it "calls the update repository storage service" do
expect_any_instance_of(Projects::UpdateRepositoryStorageService) expect_any_instance_of(Projects::UpdateRepositoryStorageService)
.to receive(:execute).with('new_storage') .to receive(:execute).with('new_storage')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment