2017-06-16 10:00:58 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
describe MergeRequestDiffCommit do
|
2017-06-16 10:00:58 -04:00
|
|
|
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
|