From 2cbad40f3ecc1d37f6b21541a7960d24eee652ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Thu, 24 Aug 2017 17:19:15 -0300 Subject: Add spec for Gitlab::Git::Commit#rugged_commit --- spec/lib/gitlab/git/commit_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb index 4c3cc04e7a0..c37508402c4 100644 --- a/spec/lib/gitlab/git/commit_spec.rb +++ b/spec/lib/gitlab/git/commit_spec.rb @@ -461,6 +461,17 @@ describe Gitlab::Git::Commit, seed_helper: true do it { is_expected.not_to include("feature") } end + describe '#rugged_commit' do + let(:raw_commit) { { id: SeedRepo::Commit::ID } } + let(:commit) { described_class.decorate(repository, raw_commit) } + subject { commit.send(:rugged_commit) } + + it 'returns a rugged commit based on the id of a non-rugged raw commit' do + expect(subject.class).to be(Rugged::Commit) + expect(subject).to eq(rugged_commit) + end + end + def sample_commit_hash { author_email: "dmitriy.zaporozhets@gmail.com", -- cgit v1.2.1