summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/gpg/commit_spec.rb
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-06-15 13:37:03 +0200
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 15:42:53 +0200
commit502e31bec9af080bcb483b0d57c8b52aeb507f93 (patch)
treeecf432badf0fc68c10b0cb78ac0153ec75e6c0d0 /spec/lib/gitlab/gpg/commit_spec.rb
parent5d5fd4babe4cb75c7f8f9f18cc86c63a0fa58d16 (diff)
downloadgitlab-ce-502e31bec9af080bcb483b0d57c8b52aeb507f93.tar.gz
memoize verified_signature call
Diffstat (limited to 'spec/lib/gitlab/gpg/commit_spec.rb')
-rw-r--r--spec/lib/gitlab/gpg/commit_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/lib/gitlab/gpg/commit_spec.rb b/spec/lib/gitlab/gpg/commit_spec.rb
index 448b16a656e..387ce8f74b4 100644
--- a/spec/lib/gitlab/gpg/commit_spec.rb
+++ b/spec/lib/gitlab/gpg/commit_spec.rb
@@ -38,11 +38,11 @@ RSpec.describe Gitlab::Gpg::Commit do
it 'returns the cached signature on second call' do
gpg_commit = described_class.new(commit)
- expect(gpg_commit).to receive(:verified_signature).twice.and_call_original
+ expect(gpg_commit).to receive(:using_keychain).and_call_original
gpg_commit.signature
# consecutive call
- expect(gpg_commit).not_to receive(:verified_signature).and_call_original
+ expect(gpg_commit).not_to receive(:using_keychain).and_call_original
gpg_commit.signature
end
end
@@ -73,11 +73,11 @@ RSpec.describe Gitlab::Gpg::Commit do
it 'returns the cached signature on second call' do
gpg_commit = described_class.new(commit)
- expect(gpg_commit).to receive(:verified_signature).and_call_original
+ expect(gpg_commit).to receive(:using_keychain).and_call_original
gpg_commit.signature
# consecutive call
- expect(gpg_commit).not_to receive(:verified_signature).and_call_original
+ expect(gpg_commit).not_to receive(:using_keychain).and_call_original
gpg_commit.signature
end
end
@@ -108,11 +108,11 @@ RSpec.describe Gitlab::Gpg::Commit do
it 'returns the cached signature on second call' do
gpg_commit = described_class.new(commit)
- expect(gpg_commit).to receive(:verified_signature).and_call_original
+ expect(gpg_commit).to receive(:using_keychain).and_call_original
gpg_commit.signature
# consecutive call
- expect(gpg_commit).not_to receive(:verified_signature).and_call_original
+ expect(gpg_commit).not_to receive(:using_keychain).and_call_original
gpg_commit.signature
end
end