diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-06-15 10:10:30 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-15 10:10:30 +0000 |
commit | f39582f7b8cc9f1fdb74b58eece944110fc0a625 (patch) | |
tree | bcccc2baef684449850e1d2bb604753affbe61c6 /spec | |
parent | 16723ff58e9dd81acb68167f2a327aa9c2b580f0 (diff) | |
parent | fbc749a96e07dd1b1b5760cfe376b5b7838181f0 (diff) | |
download | gitlab-ce-f39582f7b8cc9f1fdb74b58eece944110fc0a625.tar.gz |
Merge branch '46668-make-the-html-attribute-on-the-blob-json-call-optional' into 'master'
Resolve "Make the html attribute on the blob json call optional"
Closes #46668
See merge request gitlab-org/gitlab-ce!19479
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/blob_controller_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb index 00a7df6ccc8..9e696e9cb29 100644 --- a/spec/controllers/projects/blob_controller_spec.rb +++ b/spec/controllers/projects/blob_controller_spec.rb @@ -55,6 +55,25 @@ describe Projects::BlobController do expect(json_response).to have_key 'raw_path' end end + + context "with viewer=none" do + let(:id) { 'master/README.md' } + + before do + get(:show, + namespace_id: project.namespace, + project_id: project, + id: id, + format: :json, + viewer: 'none') + end + + it do + expect(response).to be_ok + expect(json_response).not_to have_key 'html' + expect(json_response).to have_key 'raw_path' + end + end end context 'with tree path' do |