Skip to content
Snippets Groups Projects
Commit b0ce4ca1 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Add test for MergeRequestDiff#commits_sha, feedback:

parent 4ed23a3a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment