summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index ec1c7a96f92..edcf8889c27 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -600,12 +600,16 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
describe "#refs_hash" do
- let(:refs) { repository.refs_hash }
+ subject { repository.refs_hash }
it "should have as many entries as branches and tags" do
expected_refs = SeedRepo::Repo::BRANCHES + SeedRepo::Repo::TAGS
# We flatten in case a commit is pointed at by more than one branch and/or tag
- expect(refs.values.flatten.size).to eq(expected_refs.size)
+ expect(subject.values.flatten.size).to eq(expected_refs.size)
+ end
+
+ it 'has valid commit ids as keys' do
+ expect(subject.keys).to all( match(Commit::COMMIT_SHA_PATTERN) )
end
end