diff options
author | Valery Sizov <valery@gitlab.com> | 2016-12-02 15:03:30 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-12-02 15:03:30 +0300 |
commit | f5d7a61760d8f60c27b8838db826468768154733 (patch) | |
tree | a582ecc1788ace878cdbc1467c91dd4c654b41e0 /spec/lib/gitlab/diff | |
parent | 2394afe4304626130ee70ec095b9d9b399868969 (diff) |
Fixes ActionView::Template::Error: undefined method `text?` for nil:NilClass
Diffstat (limited to 'spec/lib/gitlab/diff')
-rw-r--r-- | spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb index c863a5f04cc..2a680f03476 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb @@ -10,4 +10,12 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do described_class.new(merge_request.merge_request_diff, diff_options: nil).diff_files end + + it 'does not hightlight file if blob is not accessable' do + allow_any_instance_of(Gitlab::Diff::File).to receive(:blob).and_return(nil) + + expect_any_instance_of(Gitlab::Diff::File).not_to receive(:highlighted_diff_lines) + + described_class.new(merge_request.merge_request_diff, diff_options: nil).diff_files + end end |