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

merge_request_diff_commit_spec.rb « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9d4a0ecf8c0be2d9815544517e570f90a64a2c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'rails_helper'

describe MergeRequestDiffCommit do
  let(:merge_request) { create(:merge_request) }
  subject { merge_request.commits.first }

  describe '#to_hash' do
    it 'returns the same results as Commit#to_hash, except for parent_ids' do
      commit_from_repo = merge_request.project.repository.commit(subject.sha)
      commit_from_repo_hash = commit_from_repo.to_hash.merge(parent_ids: [])

      expect(subject.to_hash).to eq(commit_from_repo_hash)
    end
  end
end