Commit ee684a09 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Remove useless `.and_call_origin` from specs

parent ed9dc123
...@@ -276,19 +276,7 @@ describe GitlabNet, vcr: true do ...@@ -276,19 +276,7 @@ describe GitlabNet, vcr: true do
expect_any_instance_of(Redis).to receive(:initialize).with({ host: '127.0.0.1', expect_any_instance_of(Redis).to receive(:initialize).with({ host: '127.0.0.1',
port: 6379, port: 6379,
db: 0 }).and_call_original db: 0 })
gitlab_net.redis_client
end
end
context "with host and port" do
it 'uses the specified host and port' do
allow(gitlab_net).to receive(:config).and_return(config)
allow(config).to receive(:redis).and_return( { 'host' => 'localhost', 'port' => 1123 } )
expect_any_instance_of(Redis).to receive(:initialize).with({ host: 'localhost',
port: 1123,
db: 0 }).and_call_original
gitlab_net.redis_client gitlab_net.redis_client
end end
end end
...@@ -301,13 +289,13 @@ describe GitlabNet, vcr: true do ...@@ -301,13 +289,13 @@ describe GitlabNet, vcr: true do
expect_any_instance_of(Redis).to receive(:initialize).with({ host: 'localhost', expect_any_instance_of(Redis).to receive(:initialize).with({ host: 'localhost',
port: 1123, port: 1123,
db: 0, db: 0,
password: 'secret'}).and_call_original password: 'secret'})
gitlab_net.redis_client gitlab_net.redis_client
end end
end end
context "with sentinels" do context "with sentinels" do
it 'users the specified sentinels' do it 'uses the specified sentinels' do
allow(gitlab_net).to receive(:config).and_return(config) allow(gitlab_net).to receive(:config).and_return(config)
allow(config).to receive(:redis).and_return({ 'host' => 'localhost', 'port' => 1123, allow(config).to receive(:redis).and_return({ 'host' => 'localhost', 'port' => 1123,
'sentinels' => [{'host' => '127.0.0.1', 'port' => 26380}] }) 'sentinels' => [{'host' => '127.0.0.1', 'port' => 26380}] })
...@@ -315,7 +303,7 @@ describe GitlabNet, vcr: true do ...@@ -315,7 +303,7 @@ describe GitlabNet, vcr: true do
expect_any_instance_of(Redis).to receive(:initialize).with({ host: 'localhost', expect_any_instance_of(Redis).to receive(:initialize).with({ host: 'localhost',
port: 1123, port: 1123,
db: 0, db: 0,
sentinels: [{host: '127.0.0.1', port: 26380}] }).and_call_original sentinels: [{host: '127.0.0.1', port: 26380}] })
gitlab_net.redis_client gitlab_net.redis_client
end end
end end
...@@ -328,7 +316,7 @@ describe GitlabNet, vcr: true do ...@@ -328,7 +316,7 @@ describe GitlabNet, vcr: true do
allow(gitlab_net).to receive(:config).and_return(config) allow(gitlab_net).to receive(:config).and_return(config)
allow(config).to receive(:redis).and_return( { 'socket' => socket }) allow(config).to receive(:redis).and_return( { 'socket' => socket })
expect_any_instance_of(Redis).to receive(:initialize).with({ path: socket, db: 0 }).and_call_original expect_any_instance_of(Redis).to receive(:initialize).with({ path: socket, db: 0 })
gitlab_net.redis_client gitlab_net.redis_client
end end
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