Skip to content
Snippets Groups Projects
Commit c8b80247 authored by Robert Speicher's avatar Robert Speicher
Browse files

Enable the RSpec/HookArgument cop and auto-correct offenses

parent 4ef10795
No related branches found
No related tags found
No related merge requests found
Showing
with 29 additions and 30 deletions
Loading
Loading
@@ -1099,6 +1099,11 @@ RSpec/FilePath:
RSpec/Focus:
Enabled: true
 
# Checks the arguments passed to `before`, `around`, and `after`.
RSpec/HookArgument:
Enabled: true
EnforcedStyle: implicit
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: is_expected, should
RSpec/ImplicitExpect:
Loading
Loading
Loading
Loading
@@ -70,12 +70,6 @@ RSpec/EmptyLineAfterFinalLet:
RSpec/EmptyLineAfterSubject:
Enabled: false
 
# Offense count: 78
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Enabled: false
# Offense count: 9
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: it_behaves_like, it_should_behave_like
Loading
Loading
Loading
Loading
@@ -20,12 +20,12 @@ describe 'mail_room.yml' do
YAML.load(output)
end
 
before(:each) do
before do
stub_env('GITLAB_REDIS_QUEUES_CONFIG_FILE', absolute_path(queues_config_path))
clear_queues_raw_config
end
 
after(:each) do
after do
clear_queues_raw_config
end
 
Loading
Loading
Loading
Loading
@@ -320,7 +320,7 @@ describe AutocompleteController do
end
 
context 'authorized projects without admin_issue ability' do
before(:each) do
before do
authorized_project.add_guest(user)
 
expect(user.can?(:admin_issue, authorized_project)).to eq(false)
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ describe RegistrationsController do
let(:user_params) { { user: { name: 'new_user', username: 'new_username', email: 'new@user.com', password: 'Any_password' } } }
 
context 'email confirmation' do
around(:each) do |example|
around do |example|
perform_enqueued_jobs do
example.run
end
Loading
Loading
Loading
Loading
@@ -57,7 +57,7 @@ feature 'Edit group settings' do
TestEnv.clean_test_path
end
 
after(:example) do
after do
TestEnv.clean_test_path
end
 
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ feature 'Diffs URL', js: true do
let(:merge_request) { create(:merge_request, source_project: project) }
 
context 'when visit with */* as accept header' do
before(:each) do
before do
page.driver.add_header('Accept', '*/*')
end
 
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ feature 'Merge Request Discussions' do
 
let(:outdated_diff_refs) { project.commit("874797c3a73b60d2187ed6e2fcabd289ff75171e").diff_refs }
 
before(:each) do
before do
visit project_merge_request_path(project, merge_request)
end
 
Loading
Loading
@@ -71,7 +71,7 @@ feature 'Merge Request Discussions' do
end
end
 
before(:each) do
before do
visit project_merge_request_path(project, merge_request)
end
 
Loading
Loading
Loading
Loading
@@ -71,7 +71,7 @@ feature 'Merge requests > User posts diff notes', :js do
end
 
context 'with an unfolded line' do
before(:each) do
before do
find('.js-unfold', match: :first).click
wait_for_requests
end
Loading
Loading
@@ -120,7 +120,7 @@ feature 'Merge requests > User posts diff notes', :js do
end
 
context 'with an unfolded line' do
before(:each) do
before do
find('.js-unfold', match: :first).click
wait_for_requests
end
Loading
Loading
Loading
Loading
@@ -35,7 +35,7 @@ feature 'Profile > Account' do
TestEnv.clean_test_path
end
 
after(:example) do
after do
TestEnv.clean_test_path
end
 
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ feature 'Import/Export - project import integration test', js: true do
allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
end
 
after(:each) do
after do
FileUtils.rm_rf(export_path, secure: true)
end
 
Loading
Loading
Loading
Loading
@@ -65,7 +65,7 @@ describe 'Edit Project Settings' do
TestEnv.clean_test_path
end
 
after(:example) do
after do
TestEnv.clean_test_path
end
 
Loading
Loading
@@ -107,11 +107,11 @@ describe 'Edit Project Settings' do
TestEnv.clean_test_path
end
 
before(:example) do
before do
group.add_owner(user)
end
 
after(:example) do
after do
TestEnv.clean_test_path
end
 
Loading
Loading
Loading
Loading
@@ -82,7 +82,7 @@ feature 'Triggers', js: true do
end
 
describe 'trigger "Take ownership" workflow' do
before(:each) do
before do
create(:ci_trigger, owner: user2, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
end
Loading
Loading
@@ -104,7 +104,7 @@ feature 'Triggers', js: true do
end
 
describe 'trigger "Revoke" workflow' do
before(:each) do
before do
create(:ci_trigger, owner: user2, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
end
Loading
Loading
Loading
Loading
@@ -73,7 +73,7 @@ feature 'Users', js: true do
let(:loading_icon) { '.fa.fa-spinner' }
let(:username_input) { 'new_user_username' }
 
before(:each) do
before do
visit new_user_session_path
click_link 'Register'
end
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controll
clean_frontend_fixtures('abuse_reports/')
end
 
before(:each) do
before do
sign_in(admin)
end
 
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do
clean_frontend_fixtures('blob/')
end
 
before(:each) do
before do
sign_in(admin)
end
 
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller
clean_frontend_fixtures('boards/')
end
 
before(:each) do
before do
sign_in(admin)
end
 
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe Projects::BranchesController, '(JavaScript fixtures)', type: :controlle
clean_frontend_fixtures('branches/')
end
 
before(:each) do
before do
sign_in(admin)
end
 
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe Dashboard::ProjectsController, '(JavaScript fixtures)', type: :controll
clean_frontend_fixtures('dashboard/')
end
 
before(:each) do
before do
sign_in(admin)
end
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :control
clean_frontend_fixtures('deploy_keys/')
end
 
before(:each) do
before do
sign_in(admin)
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment