Commit e62dc7a2 authored by Robert Speicher's avatar Robert Speicher

Auto-correct EE-specific RSpec/HookArgument offenses

parent 6b5d9409
...@@ -135,7 +135,7 @@ describe Projects::MirrorsController do ...@@ -135,7 +135,7 @@ describe Projects::MirrorsController do
sign_in(project.owner) sign_in(project.owner)
end end
around(:each) do |example| around do |example|
Sidekiq::Testing.fake! { example.run } Sidekiq::Testing.fake! { example.run }
end end
......
...@@ -91,7 +91,7 @@ describe Banzai::Filter::UploadLinkFilter do ...@@ -91,7 +91,7 @@ describe Banzai::Filter::UploadLinkFilter do
context 'in a geo secondary node' do context 'in a geo secondary node' do
let(:geo_url) { 'http://geo.example.com' } let(:geo_url) { 'http://geo.example.com' }
before(:each) do before do
allow(Gitlab::Geo).to receive(:secondary?) { true } allow(Gitlab::Geo).to receive(:secondary?) { true }
allow(Gitlab::Geo).to receive_message_chain(:primary_node, :url) { geo_url } allow(Gitlab::Geo).to receive_message_chain(:primary_node, :url) { geo_url }
end end
......
...@@ -9,7 +9,7 @@ describe Gitlab::Geo::OauthSession do ...@@ -9,7 +9,7 @@ describe Gitlab::Geo::OauthSession do
let(:access_token) { FactoryGirl.create(:doorkeeper_access_token).token } let(:access_token) { FactoryGirl.create(:doorkeeper_access_token).token }
let(:user) { FactoryGirl.build(:user) } let(:user) { FactoryGirl.build(:user) }
before(:each) do before do
allow(subject).to receive(:oauth_app) { oauth_app } allow(subject).to receive(:oauth_app) { oauth_app }
allow(subject).to receive(:primary_node_url) { 'http://localhost:3001/' } allow(subject).to receive(:primary_node_url) { 'http://localhost:3001/' }
end end
......
...@@ -25,7 +25,7 @@ describe Gitlab::Geo::UpdateQueue do ...@@ -25,7 +25,7 @@ describe Gitlab::Geo::UpdateQueue do
end end
context 'when queue has elements' do context 'when queue has elements' do
before(:each) do before do
subject.store(dummy_data) subject.store(dummy_data)
subject.store(dummy_data2) subject.store(dummy_data2)
end end
......
...@@ -15,7 +15,7 @@ describe Gitlab::Geo do ...@@ -15,7 +15,7 @@ describe Gitlab::Geo do
end end
describe 'primary_node' do describe 'primary_node' do
before(:each) do before do
primary_node primary_node
secondary_node secondary_node
end end
...@@ -27,7 +27,7 @@ describe Gitlab::Geo do ...@@ -27,7 +27,7 @@ describe Gitlab::Geo do
describe 'primary?' do describe 'primary?' do
context 'when current node is a primary node' do context 'when current node is a primary node' do
before(:each) do before do
primary_node primary_node
end end
...@@ -45,7 +45,7 @@ describe Gitlab::Geo do ...@@ -45,7 +45,7 @@ describe Gitlab::Geo do
describe 'secondary?' do describe 'secondary?' do
context 'when current node is a secondary node' do context 'when current node is a secondary node' do
before(:each) do before do
secondary_node secondary_node
allow(described_class).to receive(:current_node) { secondary_node } allow(described_class).to receive(:current_node) { secondary_node }
end end
......
...@@ -11,7 +11,7 @@ describe API::Geo do ...@@ -11,7 +11,7 @@ describe API::Geo do
{ 'X-Gitlab-Token' => secondary_node.system_hook.token } { 'X-Gitlab-Token' => secondary_node.system_hook.token }
end end
before(:each) do before do
allow(Gitlab::Geo).to receive(:current_node) { secondary_node } allow(Gitlab::Geo).to receive(:current_node) { secondary_node }
end end
...@@ -62,7 +62,7 @@ describe API::Geo do ...@@ -62,7 +62,7 @@ describe API::Geo do
} }
end end
before(:each) do before do
allow(Gitlab::Geo).to receive(:current_node) { secondary_node } allow(Gitlab::Geo).to receive(:current_node) { secondary_node }
allow_any_instance_of(::Geo::ScheduleRepoUpdateService).to receive(:execute) allow_any_instance_of(::Geo::ScheduleRepoUpdateService).to receive(:execute)
allow_any_instance_of(::Geo::ScheduleRepoFetchService).to receive(:execute) allow_any_instance_of(::Geo::ScheduleRepoFetchService).to receive(:execute)
...@@ -339,7 +339,7 @@ describe API::Geo do ...@@ -339,7 +339,7 @@ describe API::Geo do
end end
context 'when requesting secondary node with valid auth header' do context 'when requesting secondary node with valid auth header' do
before(:each) do before do
allow(Gitlab::Geo).to receive(:current_node) { secondary_node } allow(Gitlab::Geo).to receive(:current_node) { secondary_node }
allow(request).to receive(:requesting_node) { primary_node } allow(request).to receive(:requesting_node) { primary_node }
end end
...@@ -353,7 +353,7 @@ describe API::Geo do ...@@ -353,7 +353,7 @@ describe API::Geo do
end end
context 'when requesting primary node with valid auth header' do context 'when requesting primary node with valid auth header' do
before(:each) do before do
allow(Gitlab::Geo).to receive(:current_node) { primary_node } allow(Gitlab::Geo).to receive(:current_node) { primary_node }
allow(request).to receive(:requesting_node) { secondary_node } allow(request).to receive(:requesting_node) { secondary_node }
end end
......
...@@ -7,7 +7,7 @@ describe Geo::EnqueueWikiUpdateService do ...@@ -7,7 +7,7 @@ describe Geo::EnqueueWikiUpdateService do
let(:fake_id) { 999 } let(:fake_id) { 999 }
let(:queue) { subject.instance_variable_get(:@queue) } let(:queue) { subject.instance_variable_get(:@queue) }
before(:each) do before do
queue.empty! queue.empty!
expect(project).to receive_message_chain(:wiki, :url_to_repo) { fake_url } expect(project).to receive_message_chain(:wiki, :url_to_repo) { fake_url }
expect(project).to receive(:id) { fake_id } expect(project).to receive(:id) { fake_id }
......
...@@ -85,7 +85,7 @@ describe Groups::DestroyService do ...@@ -85,7 +85,7 @@ describe Groups::DestroyService do
context 'potential race conditions' do context 'potential race conditions' do
context "when the `GroupDestroyWorker` task runs immediately" do context "when the `GroupDestroyWorker` task runs immediately" do
around(:each) do |example| around do |example|
old_strategy = DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }].strategy old_strategy = DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }].strategy
DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }].strategy = :deletion DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }].strategy = :deletion
begin begin
......
...@@ -39,7 +39,7 @@ describe Search::GroupService do ...@@ -39,7 +39,7 @@ describe Search::GroupService do
end end
describe 'elasticsearch' do describe 'elasticsearch' do
before(:each) do before do
stub_application_setting(elasticsearch_search: true, elasticsearch_indexing: true) stub_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
Gitlab::Elastic::Helper.create_empty_index Gitlab::Elastic::Helper.create_empty_index
...@@ -52,7 +52,7 @@ describe Search::GroupService do ...@@ -52,7 +52,7 @@ describe Search::GroupService do
Gitlab::Elastic::Helper.refresh_index Gitlab::Elastic::Helper.refresh_index
end end
after(:each) do after do
Gitlab::Elastic::Helper.delete_index Gitlab::Elastic::Helper.delete_index
end end
......
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