diff options
author | Mark Chao <mchao@gitlab.com> | 2019-01-23 16:50:19 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2019-03-06 15:50:55 +0800 |
commit | 90527b9f842d53595fb14a97a8f8ad19d9dc505a (patch) | |
tree | fed26f765da312e42b19e720b94dc3eab7c423b2 /spec/controllers/projects/blob_controller_spec.rb | |
parent | 154720cadc05d79fd5a89bfec18b9385964447ec (diff) | |
download | gitlab-ce-90527b9f842d53595fb14a97a8f8ad19d9dc505a.tar.gz |
Add full option for blob diff action
Returns all diff lines for frontend if full is true.
Turn UnfoldForm into presenter, and move controller logic to presenter.
Diffstat (limited to 'spec/controllers/projects/blob_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/blob_controller_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb index 38957e96798..250c4aad87f 100644 --- a/spec/controllers/projects/blob_controller_spec.rb +++ b/spec/controllers/projects/blob_controller_spec.rb @@ -192,6 +192,18 @@ describe Projects::BlobController do expect(match_line['type']).to be_nil end + + it 'returns all lines if "full" is true' do + commit_id = project.repository.commit('master').id + blob = project.repository.blob_at(commit_id, 'CHANGELOG') + do_get(full: true, from_merge_request: true, bottom: true) + + match_lines = JSON.parse(response.body) + + expect(match_lines.size).to eq(blob.lines.count - 1) + expect(match_lines.last['type']).to be_nil + expect(match_lines.last['text']).to include(blob.lines.last) + end end end end |