summaryrefslogtreecommitdiff
path: root/spec/workers/post_receive_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/post_receive_spec.rb')
-rw-r--r--spec/workers/post_receive_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index 1d2cf7acddd..984acdade36 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -79,7 +79,9 @@ describe PostReceive do
end
it "does not run if the author is not in the project" do
- allow(Key).to receive(:find_by).with(hash_including(id: anything())) { nil }
+ allow_any_instance_of(Gitlab::GitPostReceive).
+ to receive(:identify_using_ssh_key).
+ and_return(nil)
expect(project).not_to receive(:execute_hooks)
@@ -90,7 +92,13 @@ describe PostReceive do
allow(Project).to receive(:find_with_namespace).and_return(project)
expect(project).to receive(:execute_hooks).twice
expect(project).to receive(:execute_services).twice
- expect(project).to receive(:update_merge_requests)
+
+ PostReceive.new.perform(pwd(project), key_id, base64_changes)
+ end
+
+ it "enqueues a UpdateMergeRequestsWorker job" do
+ allow(Project).to receive(:find_with_namespace).and_return(project)
+ expect(UpdateMergeRequestsWorker).to receive(:perform_async).with(project.id, project.owner.id, any_args)
PostReceive.new.perform(pwd(project), key_id, base64_changes)
end