diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-21 17:49:06 -0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 12:13:46 +0200 |
commit | 5a9ede472150ec78f8410ae15cf782095c8f056c (patch) | |
tree | 5cbdbfb971329960011e8b3a3544e583f9551f6c /spec/helpers/diff_helper_spec.rb | |
parent | dad88568f34bfda5f7fe34672bc5099c80226138 (diff) | |
download | gitlab-ce-5a9ede472150ec78f8410ae15cf782095c8f056c.tar.gz |
Update mock and stub syntax for specs
Diffstat (limited to 'spec/helpers/diff_helper_spec.rb')
-rw-r--r-- | spec/helpers/diff_helper_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb index e0be2df0e5e..7c96a74e581 100644 --- a/spec/helpers/diff_helper_spec.rb +++ b/spec/helpers/diff_helper_spec.rb @@ -48,19 +48,19 @@ describe DiffHelper do end it 'should return only the first file if the diff line count in the 2nd file takes the total beyond safe limits' do - diffs[1].diff.stub(lines: [""] * 4999) #simulate 4999 lines + allow(diffs[1].diff).to receive(:lines).and_return([""] * 4999) #simulate 4999 lines expect(safe_diff_files(diffs).length).to eq(1) end it 'should return all files from a commit that is beyond safe limit for numbers of lines if force diff is true' do allow(controller).to receive(:params) { { force_show_diff: true } } - diffs[1].diff.stub(lines: [""] * 4999) #simulate 4999 lines + allow(diffs[1].diff).to receive(:lines).and_return([""] * 4999) #simulate 4999 lines expect(safe_diff_files(diffs).length).to eq(2) end it 'should return only the first file if the diff line count in the 2nd file takes the total beyond hard limits' do allow(controller).to receive(:params) { { force_show_diff: true } } - diffs[1].diff.stub(lines: [""] * 49999) #simulate 49999 lines + allow(diffs[1].diff).to receive(:lines).and_return([""] * 49999) #simulate 49999 lines expect(safe_diff_files(diffs).length).to eq(1) end |