diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-04-05 08:43:27 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2019-04-05 08:43:27 +0000 |
commit | 4ec16912b8f4eba9cc70dd21afb65c441f857da0 (patch) | |
tree | 3ca18a8657e052ed4233e8e73cea1ab5e657ebfa /spec/controllers | |
parent | 2bf4fefd12aa9ff8a757f7de8280e11cdb68bc96 (diff) | |
download | gitlab-ce-4ec16912b8f4eba9cc70dd21afb65c441f857da0.tar.gz |
Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'
Note: I had to manually fixup "onlies" to "only"
Diffstat (limited to 'spec/controllers')
12 files changed, 32 insertions, 32 deletions
diff --git a/spec/controllers/dashboard/milestones_controller_spec.rb b/spec/controllers/dashboard/milestones_controller_spec.rb index ab40b4eb178..828de0e7ca5 100644 --- a/spec/controllers/dashboard/milestones_controller_spec.rb +++ b/spec/controllers/dashboard/milestones_controller_spec.rb @@ -75,7 +75,7 @@ describe Dashboard::MilestonesController do expect(response.body).not_to include(project_milestone.title) end - it 'should show counts of group and project milestones to which the user belongs to' do + it 'shows counts of group and project milestones to which the user belongs to' do get :index expect(response.body).to include("Open\n<span class=\"badge badge-pill\">2</span>") diff --git a/spec/controllers/groups/clusters_controller_spec.rb b/spec/controllers/groups/clusters_controller_spec.rb index ef23ffaa843..e5180ec5c5c 100644 --- a/spec/controllers/groups/clusters_controller_spec.rb +++ b/spec/controllers/groups/clusters_controller_spec.rb @@ -455,7 +455,7 @@ describe Groups::ClustersController do context 'when domain is invalid' do let(:domain) { 'http://not-a-valid-domain' } - it 'should not update cluster attributes' do + it 'does not update cluster attributes' do go cluster.reload diff --git a/spec/controllers/groups/settings/ci_cd_controller_spec.rb b/spec/controllers/groups/settings/ci_cd_controller_spec.rb index 15eb0a442a6..3290ed8b088 100644 --- a/spec/controllers/groups/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/groups/settings/ci_cd_controller_spec.rb @@ -124,7 +124,7 @@ describe Groups::Settings::CiCdController do end context 'when explicitly enabling auto devops' do - it 'should update group attribute' do + it 'updates group attribute' do expect(group.auto_devops_enabled).to eq(true) end end @@ -132,7 +132,7 @@ describe Groups::Settings::CiCdController do context 'when explicitly disabling auto devops' do let(:auto_devops_param) { '0' } - it 'should update group attribute' do + it 'updates group attribute' do expect(group.auto_devops_enabled).to eq(false) end end diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index 38d7240ea81..2b803e7151f 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -566,11 +566,11 @@ describe GroupsController do } end - it 'should return a notice' do + it 'returns a notice' do expect(flash[:notice]).to eq("Group '#{group.name}' was successfully transferred.") end - it 'should redirect to the new path' do + it 'redirects to the new path' do expect(response).to redirect_to("/#{new_parent_group.path}/#{group.path}") end end @@ -587,11 +587,11 @@ describe GroupsController do } end - it 'should return a notice' do + it 'returns a notice' do expect(flash[:notice]).to eq("Group '#{group.name}' was successfully transferred.") end - it 'should redirect to the new path' do + it 'redirects to the new path' do expect(response).to redirect_to("/#{group.path}") end end @@ -611,11 +611,11 @@ describe GroupsController do } end - it 'should return an alert' do + it 'returns an alert' do expect(flash[:alert]).to eq "Transfer failed: namespace directory cannot be moved" end - it 'should redirect to the current path' do + it 'redirects to the current path' do expect(response).to redirect_to(edit_group_path(group)) end end @@ -633,7 +633,7 @@ describe GroupsController do } end - it 'should be denied' do + it 'is denied' do expect(response).to have_gitlab_http_status(404) end end diff --git a/spec/controllers/omniauth_callbacks_controller_spec.rb b/spec/controllers/omniauth_callbacks_controller_spec.rb index 06c6f49f7cc..b823a8d7463 100644 --- a/spec/controllers/omniauth_callbacks_controller_spec.rb +++ b/spec/controllers/omniauth_callbacks_controller_spec.rb @@ -55,7 +55,7 @@ describe OmniauthCallbacksController, type: :controller do allow(@routes).to receive(:generate_extras) { [path, []] } end - it 'it calls through to the failure handler' do + it 'calls through to the failure handler' do request.env['omniauth.error'] = OneLogin::RubySaml::ValidationError.new("Fingerprint mismatch") request.env['omniauth.error.strategy'] = OmniAuth::Strategies::SAML.new(nil) stub_route_as('/users/auth/saml/callback') diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb index 3801fca09dc..32949e0e7d6 100644 --- a/spec/controllers/projects/blob_controller_spec.rb +++ b/spec/controllers/projects/blob_controller_spec.rb @@ -285,7 +285,7 @@ describe Projects::BlobController do merge_request.update!(source_project: other_project, target_project: other_project) end - it "it redirect to blob" do + it "redirects to blob" do put :update, params: mr_params expect(response).to redirect_to(blob_after_edit_path) diff --git a/spec/controllers/projects/ci/lints_controller_spec.rb b/spec/controllers/projects/ci/lints_controller_spec.rb index cfa010c2d1c..0b79484bbfa 100644 --- a/spec/controllers/projects/ci/lints_controller_spec.rb +++ b/spec/controllers/projects/ci/lints_controller_spec.rb @@ -16,15 +16,15 @@ describe Projects::Ci::LintsController do get :show, params: { namespace_id: project.namespace, project_id: project } end - it 'should be success' do + it 'is success' do expect(response).to be_success end - it 'should render show page' do + it 'renders show page' do expect(response).to render_template :show end - it 'should retrieve project' do + it 'retrieves project' do expect(assigns(:project)).to eq(project) end end @@ -36,7 +36,7 @@ describe Projects::Ci::LintsController do get :show, params: { namespace_id: project.namespace, project_id: project } end - it 'should respond with 404' do + it 'responds with 404' do expect(response).to have_gitlab_http_status(404) end end @@ -74,7 +74,7 @@ describe Projects::Ci::LintsController do post :create, params: { namespace_id: project.namespace, project_id: project, content: content } end - it 'should be success' do + it 'is success' do expect(response).to be_success end @@ -82,7 +82,7 @@ describe Projects::Ci::LintsController do expect(response).to render_template :show end - it 'should retrieve project' do + it 'retrieves project' do expect(assigns(:project)).to eq(project) end end @@ -102,7 +102,7 @@ describe Projects::Ci::LintsController do post :create, params: { namespace_id: project.namespace, project_id: project, content: content } end - it 'should assign errors' do + it 'assigns errors' do expect(assigns[:error]).to eq('jobs:rubocop config contains unknown keys: scriptt') end end @@ -114,7 +114,7 @@ describe Projects::Ci::LintsController do post :create, params: { namespace_id: project.namespace, project_id: project, content: content } end - it 'should respond with 404' do + it 'responds with 404' do expect(response).to have_gitlab_http_status(404) end end diff --git a/spec/controllers/projects/commits_controller_spec.rb b/spec/controllers/projects/commits_controller_spec.rb index 8cb9130b834..9fb455dd974 100644 --- a/spec/controllers/projects/commits_controller_spec.rb +++ b/spec/controllers/projects/commits_controller_spec.rb @@ -15,7 +15,7 @@ describe Projects::CommitsController do describe "GET commits_root" do context "no ref is provided" do - it 'should redirect to the default branch of the project' do + it 'redirects to the default branch of the project' do get(:commits_root, params: { namespace_id: project.namespace, diff --git a/spec/controllers/projects/mirrors_controller_spec.rb b/spec/controllers/projects/mirrors_controller_spec.rb index 86a12a5e903..f2b73956e8d 100644 --- a/spec/controllers/projects/mirrors_controller_spec.rb +++ b/spec/controllers/projects/mirrors_controller_spec.rb @@ -65,7 +65,7 @@ describe Projects::MirrorsController do expect(flash[:notice]).to match(/successfully updated/) end - it 'should create a RemoteMirror object' do + it 'creates a RemoteMirror object' do expect { do_put(project, remote_mirrors_attributes: remote_mirror_attributes) }.to change(RemoteMirror, :count).by(1) end end @@ -82,7 +82,7 @@ describe Projects::MirrorsController do expect(flash[:alert]).to match(/Only allowed protocols are/) end - it 'should not create a RemoteMirror object' do + it 'does not create a RemoteMirror object' do expect { do_put(project, remote_mirrors_attributes: remote_mirror_attributes) }.not_to change(RemoteMirror, :count) end end diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb index 3cc3fe69fba..33486edcdd1 100644 --- a/spec/controllers/projects/project_members_controller_spec.rb +++ b/spec/controllers/projects/project_members_controller_spec.rb @@ -5,7 +5,7 @@ describe Projects::ProjectMembersController do let(:project) { create(:project, :public, :access_requestable) } describe 'GET index' do - it 'should have the project_members address with a 200 status code' do + it 'has the project_members address with a 200 status code' do get :index, params: { namespace_id: project.namespace, project_id: project } expect(response).to have_gitlab_http_status(200) diff --git a/spec/controllers/projects/services_controller_spec.rb b/spec/controllers/projects/services_controller_spec.rb index 601a292bf54..d00d5bf579d 100644 --- a/spec/controllers/projects/services_controller_spec.rb +++ b/spec/controllers/projects/services_controller_spec.rb @@ -147,7 +147,7 @@ describe Projects::ServicesController do params: { namespace_id: project.namespace, project_id: project, id: service.to_param, service: { namespace: 'updated_namespace' } } end - it 'should not update the service' do + it 'does not update the service' do service.reload expect(service.namespace).not_to eq('updated_namespace') end @@ -172,7 +172,7 @@ describe Projects::ServicesController do context 'with approved services' do let(:service_id) { 'jira' } - it 'should render edit page' do + it 'renders edit page' do expect(response).to be_success end end @@ -180,7 +180,7 @@ describe Projects::ServicesController do context 'with a deprecated service' do let(:service_id) { 'kubernetes' } - it 'should render edit page' do + it 'renders edit page' do expect(response).to be_success end end diff --git a/spec/controllers/user_callouts_controller_spec.rb b/spec/controllers/user_callouts_controller_spec.rb index c71d75a3e7f..3cbbba934b8 100644 --- a/spec/controllers/user_callouts_controller_spec.rb +++ b/spec/controllers/user_callouts_controller_spec.rb @@ -14,11 +14,11 @@ describe UserCalloutsController do let(:feature_name) { UserCallout.feature_names.keys.first } context 'when callout entry does not exist' do - it 'should create a callout entry with dismissed state' do + it 'creates a callout entry with dismissed state' do expect { subject }.to change { UserCallout.count }.by(1) end - it 'should return success' do + it 'returns success' do subject expect(response).to have_gitlab_http_status(:ok) @@ -28,7 +28,7 @@ describe UserCalloutsController do context 'when callout entry already exists' do let!(:callout) { create(:user_callout, feature_name: UserCallout.feature_names.keys.first, user: user) } - it 'should return success' do + it 'returns success' do subject expect(response).to have_gitlab_http_status(:ok) @@ -39,7 +39,7 @@ describe UserCalloutsController do context 'with invalid feature name' do let(:feature_name) { 'bogus_feature_name' } - it 'should return bad request' do + it 'returns bad request' do subject expect(response).to have_gitlab_http_status(:bad_request) |