diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-08-24 14:21:26 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-09-05 12:18:31 +0200 |
commit | 508ff17b3405a4e2275fa137bd7322b728db8ed4 (patch) | |
tree | 7e00cb57f432d92b4a6af349678efe54bb2546cb /spec/workers/create_gpg_signature_worker_spec.rb | |
parent | ff413ec28d5f0721646cea223fb5e5a054bde31e (diff) | |
download | gitlab-ce-508ff17b3405a4e2275fa137bd7322b728db8ed4.tar.gz |
pass whole commit to Gitlab::Gpg::Commit again
we need the commit object for the updated verification that also checks
the committer's email to match the gpg key and user's emails.
Diffstat (limited to 'spec/workers/create_gpg_signature_worker_spec.rb')
-rw-r--r-- | spec/workers/create_gpg_signature_worker_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/workers/create_gpg_signature_worker_spec.rb b/spec/workers/create_gpg_signature_worker_spec.rb index 54978baca88..aa6c347d738 100644 --- a/spec/workers/create_gpg_signature_worker_spec.rb +++ b/spec/workers/create_gpg_signature_worker_spec.rb @@ -7,9 +7,14 @@ describe CreateGpgSignatureWorker do let(:commit_sha) { '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' } it 'calls Gitlab::Gpg::Commit#signature' do - expect(Gitlab::Gpg::Commit).to receive(:new).with(project, commit_sha).and_call_original + commit = instance_double(Commit) + gpg_commit = instance_double(Gitlab::Gpg::Commit) - expect_any_instance_of(Gitlab::Gpg::Commit).to receive(:signature) + allow(Project).to receive(:find_by).with(id: project.id).and_return(project) + allow(project).to receive(:commit).with(commit_sha).and_return(commit) + + expect(Gitlab::Gpg::Commit).to receive(:new).with(commit).and_return(gpg_commit) + expect(gpg_commit).to receive(:signature) described_class.new.perform(commit_sha, project.id) end |