Commit b0ce4ca1 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Add test for MergeRequestDiff#commits_sha, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6470#note_15856755
parent 4ed23a3a
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment