diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb')
-rw-r--r-- | spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb b/spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb index 015dd2ba8d2..0ca99ec9acf 100644 --- a/spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb +++ b/spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do describe '#select' do it 'performs a read' do - expect(proxy).to receive(:read_using_load_balancer).with(:select, ['foo']) + expect(proxy).to receive(:read_using_load_balancer).with(:select, 'foo') proxy.select('foo') end @@ -26,7 +26,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do arel = double(:arel) expect(proxy).to receive(:read_using_load_balancer) - .with(:select_all, [arel, 'foo', []]) + .with(:select_all, arel, 'foo', []) proxy.select_all(arel, 'foo') end @@ -37,7 +37,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do arel = double(:arel, locked: true) expect(proxy).to receive(:write_using_load_balancer) - .with(:select_all, [arel, 'foo', []], sticky: true) + .with(:select_all, arel, 'foo', [], sticky: true) proxy.select_all(arel, 'foo') end @@ -48,7 +48,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do describe "#{name}" do it 'runs the query on the replica' do expect(proxy).to receive(:read_using_load_balancer) - .with(name, ['foo']) + .with(name, 'foo') proxy.send(name, 'foo') end @@ -59,7 +59,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do describe "#{name}" do it 'runs the query on the primary and sticks to it' do expect(proxy).to receive(:write_using_load_balancer) - .with(name, ['foo'], sticky: true) + .with(name, 'foo', sticky: true) proxy.send(name, 'foo') end @@ -187,7 +187,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do describe '#method_missing' do it 'runs the query on the primary without sticking to it' do expect(proxy).to receive(:write_using_load_balancer) - .with(:foo, ['foo']) + .with(:foo, 'foo') proxy.foo('foo') end @@ -197,7 +197,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(proxy).to receive(:write_using_load_balancer).and_call_original - expect { proxy.case_sensitive_comparison(:table, :attribute, :column, { value: :value, format: :format }) } + expect { proxy.case_sensitive_comparison(:table, :attribute, :column, value: :value, format: :format) } .not_to raise_error end @@ -212,7 +212,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do end it 'runs the query on the replica' do - expect(proxy).to receive(:read_using_load_balancer).with(:foo, ['foo']) + expect(proxy).to receive(:read_using_load_balancer).with(:foo, 'foo') proxy.foo('foo') end @@ -222,7 +222,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(proxy).to receive(:read_using_load_balancer).and_call_original - expect { proxy.case_sensitive_comparison(:table, :attribute, :column, { value: :value, format: :format }) } + expect { proxy.case_sensitive_comparison(:table, :attribute, :column, value: :value, format: :format) } .not_to raise_error end end @@ -245,7 +245,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(connection).to receive(:foo).with('foo') expect(proxy.load_balancer).to receive(:read).and_yield(connection) - proxy.read_using_load_balancer(:foo, ['foo']) + proxy.read_using_load_balancer(:foo, 'foo') end end @@ -257,7 +257,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(connection).to receive(:foo).with('foo') expect(proxy.load_balancer).to receive(:read).and_yield(connection) - proxy.read_using_load_balancer(:foo, ['foo']) + proxy.read_using_load_balancer(:foo, 'foo') end end @@ -269,7 +269,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(connection).to receive(:foo).with('foo') expect(proxy.load_balancer).to receive(:read).and_yield(connection) - proxy.read_using_load_balancer(:foo, ['foo']) + proxy.read_using_load_balancer(:foo, 'foo') end end @@ -283,7 +283,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(proxy.load_balancer).to receive(:read_write) .and_yield(connection) - proxy.read_using_load_balancer(:foo, ['foo']) + proxy.read_using_load_balancer(:foo, 'foo') end end end @@ -302,7 +302,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(connection).to receive(:foo).with('foo') expect(session).not_to receive(:write!) - proxy.write_using_load_balancer(:foo, ['foo']) + proxy.write_using_load_balancer(:foo, 'foo') end it 'sticks to the primary when sticking is enabled' do @@ -310,7 +310,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ConnectionProxy do expect(connection).to receive(:foo).with('foo') expect(session).to receive(:write!) - proxy.write_using_load_balancer(:foo, ['foo'], sticky: true) + proxy.write_using_load_balancer(:foo, 'foo', sticky: true) end end end |