diff options
Diffstat (limited to 'spec/models/merge_request_diff_spec.rb')
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index b86663fd7d9..0f7f68e0b38 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -378,6 +378,14 @@ describe MergeRequestDiff do expect(diff_with_commits.commit_shas).not_to be_empty expect(diff_with_commits.commit_shas).to all(match(/\h{40}/)) end + + context 'with limit attribute' do + it 'returns limited number of shas' do + expect(diff_with_commits.commit_shas(limit: 2).size).to eq(2) + expect(diff_with_commits.commit_shas(limit: 100).size).to eq(29) + expect(diff_with_commits.commit_shas.size).to eq(29) + end + end end describe '#compare_with' do |