Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-06-16 15:43:01 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:42:53 +0300
commit028ecb081b7ed71d5123ded535d5b7f87db7cc67 (patch)
treef2ecccb9572c9e607be318beaa5965817f7ded23 /spec/lib/gitlab/gpg
parentd7f42643681ad1cc634a502ef25acab6b111c6e5 (diff)
need to wrap the raw commit in a commit model
Diffstat (limited to 'spec/lib/gitlab/gpg')
-rw-r--r--spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb b/spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb
index 42348b3f2c1..8b60b36452b 100644
--- a/spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb
+++ b/spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb
@@ -4,13 +4,18 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
describe '#run' do
let!(:commit_sha) { '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' }
let!(:project) { create :project, :repository, path: 'sample-project' }
- let!(:commit) do
+ let!(:raw_commit) do
raw_commit = double(:raw_commit, signature: [
GpgHelpers::User1.signed_commit_signature,
GpgHelpers::User1.signed_commit_base_data
], sha: commit_sha)
+
allow(raw_commit).to receive :save!
+ raw_commit
+ end
+
+ let!(:commit) do
create :commit, git_commit: raw_commit, project: project
end
@@ -24,7 +29,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
end
before do
- allow(Gitlab::Git::Commit).to receive(:find).with(kind_of(Repository), commit_sha).and_return(commit)
+ allow(Gitlab::Git::Commit).to receive(:find).with(kind_of(Repository), commit_sha).and_return(raw_commit)
end
context 'gpg signature did not have an associated gpg key' do