diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-12-30 22:16:25 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-01-12 18:41:29 +0300 |
commit | ca0cf5a3cd2829db4cfac007c36d5588ed369f87 (patch) | |
tree | bc5783a137de10e25358a24d764b50daabdf68ef /spec/models/merge_request_diff_spec.rb | |
parent | ec4fe4432a2c4daa14c8e8f7c5d8567553062ebf (diff) |
Show 'too many changes' message for merge request
Diffstat (limited to 'spec/models/merge_request_diff_spec.rb')
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index eb876d105da..6d599e148a2 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -76,6 +76,32 @@ describe MergeRequestDiff, models: true do end end + describe '#save_diffs' do + it 'saves collected state' do + mr_diff = create(:merge_request).merge_request_diff + + expect(mr_diff.collected?).to be_truthy + end + + it 'saves overflow state' do + allow(Commit).to receive(:max_diff_options) + .and_return(max_lines: 0, max_files: 0) + + mr_diff = create(:merge_request).merge_request_diff + + expect(mr_diff.overflow?).to be_truthy + end + + it 'saves empty state' do + allow_any_instance_of(MergeRequestDiff).to receive(:commits) + .and_return([]) + + mr_diff = create(:merge_request).merge_request_diff + + expect(mr_diff.empty?).to be_truthy + end + end + describe '#commits_sha' do it 'returns all commits SHA using serialized commits' do subject.st_commits = [ |