diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 15:07:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 15:07:33 +0300 |
commit | 6b75320f525f841454f1ab162d141d3610f2e77b (patch) | |
tree | 4971c27759e4fbc18b85e71800c3b9c12346317e /spec/models/gpg_signature_spec.rb | |
parent | 4226aca420920c1844e8eade4798a2dff188a6fc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/gpg_signature_spec.rb')
-rw-r--r-- | spec/models/gpg_signature_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/gpg_signature_spec.rb b/spec/models/gpg_signature_spec.rb index 4911375c962..dd18c8842ab 100644 --- a/spec/models/gpg_signature_spec.rb +++ b/spec/models/gpg_signature_spec.rb @@ -60,6 +60,18 @@ RSpec.describe GpgSignature do end end + describe '.by_commit_sha scope' do + let(:gpg_key) { create(:gpg_key, key: GpgHelpers::User2.public_key) } + let!(:another_gpg_signature) { create(:gpg_signature, gpg_key: gpg_key) } + + it 'returns all gpg signatures by sha' do + expect(described_class.by_commit_sha(commit_sha)).to eq([gpg_signature]) + expect( + described_class.by_commit_sha([commit_sha, another_gpg_signature.commit_sha]) + ).to contain_exactly(gpg_signature, another_gpg_signature) + end + end + describe '#commit' do it 'fetches the commit through the project' do expect_any_instance_of(Project).to receive(:commit).with(commit_sha).and_return(commit) |