diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/notifications_spec.rb | 11 | ||||
-rw-r--r-- | spec/requests/api/internal_spec.rb | 4 |
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 |