Add test for MergeRequestDiff#commits_sha, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6470#note_15856755
This commit is contained in:
parent
4ed23a3a57
commit
b0ce4ca110
1 changed files with 22 additions and 0 deletions
|
@ -64,5 +64,27 @@ describe MergeRequestDiff, models: true do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#commits_sha' do
|
||||
shared_examples 'returning all commits SHA' do
|
||||
it 'returns all commits SHA' do
|
||||
commits_sha = subject.commits_sha
|
||||
|
||||
expect(commits_sha).to eq(subject.commits.map(&:sha))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when commits were loaded' do
|
||||
before do
|
||||
subject.commits
|
||||
end
|
||||
|
||||
it_behaves_like 'returning all commits SHA'
|
||||
end
|
||||
|
||||
context 'when commits were not loaded' do
|
||||
it_behaves_like 'returning all commits SHA'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue