diff options
Diffstat (limited to 'spec/models/diff_viewer/base_spec.rb')
-rw-r--r-- | spec/models/diff_viewer/base_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/diff_viewer/base_spec.rb b/spec/models/diff_viewer/base_spec.rb index 8ab7b090928..17925ef2576 100644 --- a/spec/models/diff_viewer/base_spec.rb +++ b/spec/models/diff_viewer/base_spec.rb @@ -100,6 +100,28 @@ RSpec.describe DiffViewer::Base do end end + describe '#generated?' do + before do + allow(diff_file).to receive(:generated?).and_return(generated) + end + + context 'when the diff file is generated' do + let(:generated) { true } + + it 'returns true' do + expect(viewer.generated?).to be_truthy + end + end + + context 'when the diff file is not generated' do + let(:generated) { false } + + it 'returns true' do + expect(viewer.generated?).to be_falsey + end + end + end + describe '#render_error' do context 'when the combined blob size is larger than the size limit' do before do |