Commit 7e217eb7 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'autocorrect_example_wording_ee_spec' into 'master'

Autocorrect ee/spec with RSpec/ExampleWording cop

See merge request gitlab-org/gitlab-ee!10591
parents 3a10bfdb 29d0d580
......@@ -10,7 +10,7 @@ describe Dashboard::ProjectsController do
describe '#index' do
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
get :index
......
......@@ -150,7 +150,7 @@ describe GroupsController do
end
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')
end
end
......@@ -159,7 +159,7 @@ describe GroupsController do
let(:user) { create(:user, group_view: :security_dashboard) }
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))
end
end
......@@ -167,7 +167,7 @@ describe GroupsController do
context 'in Atom format' do
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')
end
end
......@@ -177,7 +177,7 @@ describe GroupsController do
stub_feature_flags(group_overview_security_dashboard: false)
end
it 'should render the expected template' do
it 'renders the expected template' do
expect(subject).to render_template('groups/show')
end
end
......@@ -223,7 +223,7 @@ describe GroupsController do
context 'with group view set to security dashboard' do
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))
end
......@@ -232,7 +232,7 @@ describe GroupsController do
stub_feature_flags(group_overview_security_dashboard: false)
end
it 'should render the expected template' do
it 'renders the expected template' do
expect(subject).to render_template('groups/show')
end
end
......
......@@ -142,7 +142,7 @@ describe Projects::EnvironmentsController do
get :terminal, params: environment_params
end
it 'should response with access denied' do
it 'responds with access denied' do
expect(response).to have_gitlab_http_status(404)
end
end
......@@ -154,14 +154,14 @@ describe Projects::EnvironmentsController do
get :terminal, params: environment_params
end
it 'should be successful' do
it 'is successful' do
expect(response).to have_gitlab_http_status(200)
end
end
end
context 'when environment is not protected' do
it 'should be successful' do
it 'is successful' do
get :terminal, params: environment_params
expect(response).to have_gitlab_http_status(200)
......
......@@ -11,7 +11,7 @@ describe Projects::ImportsController do
context 'POST #create' do
context 'mirror user is not the current user' do
it 'should only assign the current user' do
it 'only assigns the current user' do
allow_any_instance_of(EE::Project).to receive(:add_import_job)
new_user = create(:user)
......
......@@ -31,19 +31,19 @@ describe Projects::ProtectedEnvironmentsController do
end
context 'with valid params' do
it 'should create a new ProtectedEnvironment' do
it 'creates a new ProtectedEnvironment' do
expect do
subject
end.to change(ProtectedEnvironment, :count).by(1)
end
it 'should set a flash' do
it 'sets a flash' do
subject
expect(controller).to set_flash[:notice].to(/environment has been protected/)
end
it 'should redirect to CI/CD settings' do
it 'redirects to CI/CD settings' do
subject
expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings')
......@@ -57,13 +57,13 @@ describe Projects::ProtectedEnvironmentsController do
deploy_access_levels_attributes: [{ access_level: maintainer_access }])
end
it 'should not create a new ProtectedEnvironment' do
it 'does not create a new ProtectedEnvironment' do
expect do
subject
end.not_to change(ProtectedEnvironment, :count)
end
it 'should redirect to CI/CD settings' do
it 'redirects to CI/CD settings' do
subject
expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings')
......@@ -76,7 +76,7 @@ describe Projects::ProtectedEnvironmentsController do
project.add_developer(current_user)
end
it 'should render 404' do
it 'renders 404' do
subject
expect(response).to have_gitlab_http_status(404)
......@@ -114,15 +114,15 @@ describe Projects::ProtectedEnvironmentsController do
subject
end
it 'should find the requested protected environment' do
it 'finds the requested protected environment' do
expect(assigns(:protected_environment)).to eq(protected_environment)
end
it 'should update the protected environment' do
it 'updates the protected environment' do
expect(protected_environment.deploy_access_levels.count).to eq(2)
end
it 'should be success' do
it 'is successful' do
expect(response).to have_gitlab_http_status(200)
end
end
......@@ -134,7 +134,7 @@ describe Projects::ProtectedEnvironmentsController do
subject
end
it 'should not be success' do
it 'is not successful' do
expect(response).to have_gitlab_http_status(404)
end
end
......@@ -157,19 +157,19 @@ describe Projects::ProtectedEnvironmentsController do
project.add_maintainer(current_user)
end
it 'should find the requested protected environment' do
it 'finds the requested protected environment' do
subject
expect(assigns(:protected_environment)).to eq(protected_environment)
end
it 'should delete the requested protected environment' do
it 'deletes the requested protected environment' do
expect do
subject
end.to change { ProtectedEnvironment.count }.from(1).to(0)
end
it 'should redirect to CI/CD settings' do
it 'redirects to CI/CD settings' do
subject
expect(response).to redirect_to project_settings_ci_cd_path(project, anchor: 'js-protected-environments-settings')
......@@ -181,7 +181,7 @@ describe Projects::ProtectedEnvironmentsController do
project.add_developer(current_user)
end
it 'should not be success' do
it 'is not successful' do
subject
expect(response).to have_gitlab_http_status(404)
......
......@@ -13,7 +13,7 @@ describe 'CI shared runner settings' do
end
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
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
expect(page).to have_selector('.shared_runners_limit_disabled')
......@@ -25,20 +25,20 @@ describe 'CI shared runner settings' do
set_admin_shared_runners_minutes 500
end
it 'should display ratio with global quota' do
it 'displays ratio with global quota' do
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / 500")
expect(page).to have_selector('.shared_runners_limit_under_quota')
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
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / 300")
expect(page).to have_selector('.shared_runners_limit_over_quota')
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
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
......
......@@ -15,12 +15,12 @@ describe 'CI shared runner limits' do
end
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
expect_no_quota_exceeded_alert
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
expect_no_quota_exceeded_alert
end
......@@ -30,12 +30,12 @@ describe 'CI shared runner limits' do
context 'when limit is exceeded' do
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
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end
it 'it displays a warning message on pipelines page' do
it 'displays a warning message on pipelines page' do
visit_project_pipelines
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end
......@@ -44,12 +44,12 @@ describe 'CI shared runner limits' do
context 'when limit not yet exceeded' do
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
expect_no_quota_exceeded_alert
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
expect_no_quota_exceeded_alert
end
......@@ -58,12 +58,12 @@ describe 'CI shared runner limits' do
context 'when minutes are not yet set' do
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
expect_no_quota_exceeded_alert
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
expect_no_quota_exceeded_alert
end
......@@ -75,12 +75,12 @@ describe 'CI shared runner limits' do
let(:group) { create(:group, :with_used_build_minutes_limit) }
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
expect_no_quota_exceeded_alert
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
expect_no_quota_exceeded_alert
end
......
......@@ -46,7 +46,7 @@ describe 'Dropdown weight', :js do
expect(page).to have_css(js_dropdown_weight, visible: false)
end
it 'should load all the weights when opened' do
it 'loads all the weights when opened' do
send_keys_to_filtered_search('weight:')
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
wait_for_requests
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
page.within '.dropdown-menu-user' do
......
......@@ -11,7 +11,7 @@ describe 'Issues sub nav EE' do
visit project_issues_path(project)
end
it 'should have a `Boards` item' do
it 'has a `Boards` item' do
expect(find('.nav-sidebar')).to have_content 'Boards'
end
end
......@@ -35,7 +35,7 @@ describe 'Pipeline', :js do
end
context 'expands the upstream pipeline on click' do
it 'should expand the upstream on click' do
it 'expands the upstream on click' do
subject
page.find(".js-pipeline-expand-#{upstream_pipeline.id}").click
......@@ -43,7 +43,7 @@ describe 'Pipeline', :js do
expect(page).to have_selector(".js-upstream-pipeline-#{upstream_pipeline.id}")
end
it 'should close the expanded upstream on click' do
it 'closes the expanded upstream on click' do
subject
# open
......@@ -65,7 +65,7 @@ describe 'Pipeline', :js do
end
context 'expands the downstream pipeline on click' do
it 'should expand the downstream on click' do
it 'expands the downstream on click' do
subject
page.find(".js-pipeline-expand-#{downstream_pipeline.id}").click
......@@ -73,7 +73,7 @@ describe 'Pipeline', :js do
expect(page).to have_selector(".js-downstream-pipeline-#{downstream_pipeline.id}")
end
it 'should close the expanded downstream on click' do
it 'closes the expanded downstream on click' do
subject
# open
......
......@@ -15,7 +15,7 @@ describe 'Promotions', :js do
project.add_maintainer(user)
end
it 'should show no promotion at all' do
it 'shows no promotion at all' do
sign_in(user)
visit edit_project_path(project)
......@@ -31,14 +31,14 @@ describe 'Promotions', :js do
project.add_maintainer(user)
end
it 'should have the contact admin line' do
it 'has the contact admin line' do
sign_in(user)
visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Contact your Administrator to upgrade your license.'
end
it 'should have the start trial button' do
it 'has the start trial button' do
sign_in(admin)
visit edit_project_path(project)
......@@ -59,13 +59,13 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should have the Upgrade your plan button' do
it "has the 'Upgrade your plan' button" do
visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Upgrade your plan'
end
it 'should have the contact owner line' do
it 'has the contact owner line' do
visit edit_project_path(otherproject)
expect(find('#promote_service_desk')).to have_content 'Contact owner'
......@@ -82,7 +82,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear in project edit page' do
it 'appears in project edit page' do
visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Improve customer support with GitLab Service Desk.'
......@@ -112,7 +112,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear in project edit page' do
it 'appears in project edit page' do
visit edit_project_path(project)
expect(find('#promote_mr_features')).to have_content 'Improve Merge Requests'
......@@ -142,7 +142,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear in repository settings page' do
it 'appears in repository settings page' do
visit project_settings_repository_path(project)
expect(find('#promote_repository_features')).to have_content 'Improve repositories with GitLab Enterprise Edition'
......@@ -170,7 +170,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear in milestone page' do
it 'appears in milestone page' do
visit project_milestone_path(project, milestone)
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
sign_in(user)
end
it 'should appear in milestone page' do
it 'appears in milestone page' do
visit project_boards_path(project)
expect(find('.board-promotion-state')).to have_content "Upgrade your plan to improve Issue boards"
......@@ -226,7 +226,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on export modal' do
it 'appears on export modal' do
visit project_issues_path(project)
click_on 'Export as CSV'
......@@ -237,7 +237,7 @@ describe 'Promotions', :js do
describe 'for epics in issues sidebar', :js 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)
wait_for_requests
......@@ -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'
end
it 'should be removed after dismissal' do
it 'is removed after dismissal' do
visit project_issue_path(project, issue)
wait_for_requests
......@@ -256,7 +256,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.promotion-issue-sidebar-message')
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)
wait_for_requests
......@@ -267,7 +267,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.js-epics-sidebar-callout')
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)
wait_for_requests
......@@ -313,7 +313,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on the page', :js do
it 'appears on the page', :js do
visit project_issue_path(project, issue)
wait_for_requests
......@@ -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'
end
it 'should be removed after dismissal' do
it 'is removed after dismissal' do
visit project_issue_path(project, issue)
wait_for_requests
......@@ -332,7 +332,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.js-weight-sidebar-callout')
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)
wait_for_requests
......@@ -343,7 +343,7 @@ describe 'Promotions', :js do
expect(page).not_to have_selector('.js-weight-sidebar-callout')
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)
wait_for_requests
......@@ -364,7 +364,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on the page', :js do
it 'appears on the page', :js do
visit new_project_issue_path(project)
wait_for_requests
......@@ -383,7 +383,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on the page' do
it 'appears on the page' do
visit project_audit_events_path(project)
expect(find('.user-callout-copy')).to have_content 'Track your project with Audit Events'
......@@ -399,7 +399,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on the page' do
it 'appears on the page' do
visit group_analytics_path(group)
expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution Analytics.'
......@@ -415,7 +415,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on the page' do
it 'appears on the page' do
visit group_hooks_path(group)
expect(find('.user-callout-copy')).to have_content 'Add Group Webhooks'
......@@ -430,7 +430,7 @@ describe 'Promotions', :js do
sign_in(user)
end
it 'should appear on seearch page' do
it 'appears on seearch page' do
visit search_path
fill_in 'search', with: 'chosen'
......
......@@ -12,7 +12,7 @@ describe EE::EmailsHelper do
end
with_them do
it 'should return the expected title' do
it 'returns the expected title' do
title = helper.action_title(path)
expect(title).to eq(result)
end
......
......@@ -126,7 +126,7 @@ describe EpicsHelper do
end
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({})
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
expect(access.load!).to eq(access)
end
it 'it stores the result in redis' do
it 'stores the result in redis' do
Timecop.freeze do
fake_cache = double
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
expect(access.loaded_at).not_to be_nil
end
it 'it does not store the result in redis' do
it 'does not store the result in redis' do
fake_cache = double
expect(fake_cache).not_to receive(:store)
allow(access).to receive(:cache).and_return(fake_cache)
......
......@@ -140,7 +140,7 @@ describe Gitlab::Database::LoadBalancing::ConnectionProxy do
.and_return(session)
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(connection).to receive(:foo).with('foo')
expect(session).not_to receive(:write!)
......
......@@ -39,7 +39,7 @@ describe Burndown do
expect(subject).to eq([].to_json)
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
expect(JSON.parse(subject).last[0]).to eq(Time.now.strftime("%Y-%m-%d"))
end
......
......@@ -231,7 +231,7 @@ describe EE::DeploymentPlatform do
stub_licensed_features(multiple_clusters: true)
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_2)).to eq(cluster_2.platform_kubernetes)
end
......
......@@ -2186,7 +2186,7 @@ describe Project do
end
describe '#create_import_state' do
it 'it is called after save' do
it 'is called after save' do
project = create(:project)
expect(project).to receive(:create_import_state)
......
......@@ -53,7 +53,7 @@ describe PrometheusAlertEvent do
context 'when status is none' do
subject { build(:prometheus_alert_event, :none) }
it 'it fires an event' do
it 'fires an event' do
result = subject.fire(started_at)
expect(result).to eq(true)
......@@ -79,7 +79,7 @@ describe PrometheusAlertEvent do
context 'when firing' do
subject { build(:prometheus_alert_event) }
it 'it resolves an event' do
it 'resolves an event' do
result = subject.resolve!(ended_at)
expect(result).to eq(true)
......
......@@ -42,13 +42,13 @@ describe ProtectedEnvironment do
create_deploy_access_level(group: group)
end
it 'should allow members of the group' do
it 'allows members of the group' do
group.add_developer(user)
expect(subject).to be_truthy
end
it 'should reject non-members of the group' do
it 'rejects non-members of the group' do
expect(subject).to be_falsy
end
end
......@@ -58,13 +58,13 @@ describe ProtectedEnvironment do
create_deploy_access_level(access_level: Gitlab::Access::MAINTAINER)
end
it 'should allow maintainers' do
it 'allows maintainers' do
project.add_maintainer(user)
expect(subject).to be_truthy
end
it 'should reject developers' do
it 'rejects developers' do
project.add_developer(user)
expect(subject).to be_falsy
......@@ -76,13 +76,13 @@ describe ProtectedEnvironment do
create_deploy_access_level(access_level: Gitlab::Access::DEVELOPER)
end
it 'should allow maintainers' do
it 'allows maintainers' do
project.add_maintainer(user)
expect(subject).to be_truthy
end
it 'should allow developers' do
it 'allows developers' do
project.add_developer(user)
expect(subject).to be_truthy
......
......@@ -57,7 +57,7 @@ describe API::ProjectClusters do
end
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
expect(json_response['environment_scope']).to eq('production/*')
......@@ -72,7 +72,7 @@ describe API::ProjectClusters do
}
end
it 'should set default environment' do
it 'sets default environment' do
post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params
expect(json_response['environment_scope']).to eq('*')
......@@ -89,11 +89,11 @@ describe API::ProjectClusters do
post api("/projects/#{project.id}/clusters/user", current_user), params: cluster_params
end
it 'should respond with 201' do
it 'responds with 201' do
expect(response).to have_gitlab_http_status(201)
end
it 'should allow to associate multiple cluster to project' do
it 'allows multiple clusters to be associated to project' do
expect(project.reload.clusters.count).to eq(2)
end
end
......@@ -124,7 +124,7 @@ describe API::ProjectClusters do
projects: [project])
end
it 'should update the environment scope' do
it 'updates the environment scope' do
expect(cluster.environment_scope).to eq('test/*')
end
end
......@@ -135,7 +135,7 @@ describe API::ProjectClusters do
projects: [project])
end
it 'should update the environment scope' do
it 'updates the environment scope' do
expect(cluster.environment_scope).to eq('test/*')
end
end
......
......@@ -13,7 +13,7 @@ describe 'JIRA authorization requests' do
let(:client_id) { application.uid }
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 = {
client_id: client_id,
client_secret: client_secret
......
......@@ -94,7 +94,7 @@ describe MergeRequestWidgetEntity do
stub_licensed_features(license_management: true)
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)
end
......@@ -103,7 +103,7 @@ describe MergeRequestWidgetEntity do
create(:ee_ci_build, :license_management, pipeline: pipeline)
end
it 'should be included' do
it 'is included' do
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(:base_path)
......@@ -118,7 +118,7 @@ describe MergeRequestWidgetEntity do
stub_licensed_features(license_management: false)
end
it 'should not be included' do
it 'is not included' do
expect(subject.as_json).not_to include(:license_management)
end
end
......@@ -143,7 +143,7 @@ describe MergeRequestWidgetEntity do
create(:ee_ci_build, :legacy_license_management, pipeline: pipeline)
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[:license_management]).to include(:head_path)
expect(subject.as_json[:license_management]).to include(:base_path)
......@@ -160,7 +160,7 @@ describe MergeRequestWidgetEntity do
create(:ee_ci_build, :legacy_license_management, pipeline: pipeline)
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)
end
......@@ -174,7 +174,7 @@ describe MergeRequestWidgetEntity do
stub_licensed_features(license_management: true)
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)
end
end
......
......@@ -34,7 +34,7 @@ describe Ci::ProcessBuildService, '#execute' do
let(:feature_available) { true }
context 'when user does not have access to the environment' do
it 'should fail the build' do
it 'fails the build' do
subject
expect(ci_build.failed?).to be_truthy
......
......@@ -19,7 +19,7 @@ describe Groups::ParticipantsService do
end
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))
end
end
......@@ -36,7 +36,7 @@ describe Groups::ParticipantsService do
create(:note, author: user, project: nil, noteable: epic, note: @users.map { |u| u.to_reference }.join(' '))
end
it 'should return all participants' do
it 'returns all participants' do
service = described_class.new(group, user)
service.instance_variable_set(:@noteable, epic)
result = service.participants_in_noteable
......@@ -53,7 +53,7 @@ describe Groups::ParticipantsService do
let(:subgroup) { create(:group_with_members, parent: group) }
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))
subgroup.add_developer(create(:user))
subproject.add_developer(create(:user))
......@@ -74,12 +74,12 @@ describe Groups::ParticipantsService do
describe 'avatar_url' do
let(:groups) { described_class.new(group, user).groups }
it 'should return an url for the avatar' do
it 'returns a URL for the avatar' do
expect(groups.size).to eq 1
expect(groups.first[:avatar_url]).to eq("/uploads/-/system/group/avatar/#{group.id}/dk.png")
end
it 'should return an url for the avatar with relative url' do
it 'returns a relative URL for the avatar' do
stub_config_setting(relative_url_root: '/gitlab')
stub_config_setting(url: Settings.send(:build_gitlab_url))
......
......@@ -89,7 +89,7 @@ describe Projects::Prometheus::Alerts::CreateEventsService do
started_at: started_at)
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 }
end
......@@ -105,7 +105,7 @@ describe Projects::Prometheus::Alerts::CreateEventsService do
context 'with duplicate payload' do
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 }
end
......
......@@ -16,11 +16,11 @@ describe ProtectedEnvironments::CreateService, '#execute' do
context 'with valid params' do
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)
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)
end
end
......@@ -28,7 +28,7 @@ describe ProtectedEnvironments::CreateService, '#execute' do
context 'with invalid params' do
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
end
end
......
......@@ -12,13 +12,13 @@ describe ProtectedEnvironments::DestroyService, '#execute' do
context 'when the Protected Environment is deleted' do
it { is_expected.to be_truthy }
it 'should delete the requested ProtectedEnvironment' do
it 'deletes the requested ProtectedEnvironment' do
expect do
subject
end.to change { ProtectedEnvironment.count }.from(1).to(0)
end
it 'should delete the related DeployAccessLevel' do
it 'deletes the related DeployAccessLevel' do
expect do
subject
end.to change { ProtectedEnvironment::DeployAccessLevel.count }.from(1).to(0)
......
......@@ -37,7 +37,7 @@ describe ProtectedEnvironments::SearchService, '#execute' do
context 'when no match' do
let(:environment_name) { 'no_match' }
it 'should return an empty array' do
it 'returns an empty array' do
expect(subject).to eq([])
end
end
......
......@@ -26,7 +26,7 @@ describe ProtectedEnvironments::UpdateService, '#execute' do
context 'with valid params' do
it { is_expected.to be_truthy }
it 'should change update the deploy access levels' do
it 'updates the deploy access levels' do
expect do
subject
end.to change { ProtectedEnvironment::DeployAccessLevel.count }.from(1).to(2)
......@@ -38,7 +38,7 @@ describe ProtectedEnvironments::UpdateService, '#execute' do
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
subject
end.not_to change { ProtectedEnvironment::DeployAccessLevel.count }
......
......@@ -20,7 +20,7 @@ RSpec.shared_examples 'restricts access to protected environments' do |developer
end
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) }
.to raise_error Gitlab::Access::AccessDeniedError
end
......
......@@ -6,7 +6,7 @@ describe ProjectUpdateRepositoryStorageWorker do
subject { described_class.new }
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)
.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