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