diff options
author | Felipe Artur <felipefac@gmail.com> | 2018-07-04 12:34:41 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2018-07-04 12:34:41 -0300 |
commit | 6d41df507143f87e33f335bc8c405a006a7f8a8d (patch) | |
tree | 054f21647b480638d7497b6e4f7f814c0fb9064b /spec/serializers | |
parent | d66bbf82b31b60c26646955c61e6a934b89d8a69 (diff) | |
download | gitlab-ce-6d41df507143f87e33f335bc8c405a006a7f8a8d.tar.gz |
Render LegacyDiffNote when diff_file blob is nil
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/diff_file_entity_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/serializers/diff_file_entity_spec.rb b/spec/serializers/diff_file_entity_spec.rb index c4a6c117b76..00b2146dc86 100644 --- a/spec/serializers/diff_file_entity_spec.rb +++ b/spec/serializers/diff_file_entity_spec.rb @@ -25,6 +25,20 @@ describe DiffFileEntity do :context_lines_path ) end + + # Converted diff files from GitHub import does not contain blob file + # and content sha. + context 'when diff file does not have a blob and content sha' do + it 'exposes some attributes as nil' do + allow(diff_file).to receive(:content_sha).and_return(nil) + allow(diff_file).to receive(:blob).and_return(nil) + + expect(subject[:context_lines_path]).to be_nil + expect(subject[:view_path]).to be_nil + expect(subject[:highlighted_diff_lines]).to be_nil + expect(subject[:can_modify_blob]).to be_nil + end + end end context 'when there is no merge request' do |