summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-03-22 18:23:40 +0100
committerJacob Vosmaer <jacob@gitlab.com>2017-03-29 14:48:05 +0200
commit8f50ef5e75fedc6f8c2a5b1c52e119c4c1df7c4e (patch)
tree28d6d978e1e80985a5fa53921013f126adb8563f /spec
parentc837da34391094b9d58763a67db5cfb706ca146f (diff)
downloadgitlab-ce-8f50ef5e75fedc6f8c2a5b1c52e119c4c1df7c4e.tar.gz
Separate GRPC channels per repository storage
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/gitaly_client/notifications_spec.rb11
-rw-r--r--spec/requests/api/internal_spec.rb4
2 files changed, 4 insertions, 11 deletions
diff --git a/spec/lib/gitlab/gitaly_client/notifications_spec.rb b/spec/lib/gitlab/gitaly_client/notifications_spec.rb
index a6252c99aa1..bb5d93994ad 100644
--- a/spec/lib/gitlab/gitaly_client/notifications_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/notifications_spec.rb
@@ -1,20 +1,13 @@
require 'spec_helper'
describe Gitlab::GitalyClient::Notifications do
- let(:client) { Gitlab::GitalyClient::Notifications.new }
-
- before do
- allow(Gitlab.config.gitaly).to receive(:socket_path).and_return('path/to/gitaly.socket')
- end
-
describe '#post_receive' do
- let(:repo_path) { '/path/to/my_repo.git' }
-
it 'sends a post_receive message' do
+ repo_path = create(:empty_project).repository.path_to_repo
expect_any_instance_of(Gitaly::Notifications::Stub).
to receive(:post_receive).with(post_receive_request_with_repo_path(repo_path))
- client.post_receive(repo_path)
+ described_class.new(repo_path).post_receive
end
end
end
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index 63ec00cdf04..e25157a8abc 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -429,7 +429,7 @@ describe API::Internal, api: true do
it "calls the Gitaly client if it's enabled" do
expect_any_instance_of(Gitlab::GitalyClient::Notifications).
- to receive(:post_receive).with(project.repository.path)
+ to receive(:post_receive)
post api("/internal/notify_post_receive"), valid_params
@@ -438,7 +438,7 @@ describe API::Internal, api: true do
it "returns 500 if the gitaly call fails" do
expect_any_instance_of(Gitlab::GitalyClient::Notifications).
- to receive(:post_receive).with(project.repository.path).and_raise(GRPC::Unavailable)
+ to receive(:post_receive).and_raise(GRPC::Unavailable)
post api("/internal/notify_post_receive"), valid_params