summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-06-15 10:10:30 +0000
committerDouwe Maan <douwe@gitlab.com>2018-06-15 10:10:30 +0000
commitf39582f7b8cc9f1fdb74b58eece944110fc0a625 (patch)
treebcccc2baef684449850e1d2bb604753affbe61c6 /spec
parent16723ff58e9dd81acb68167f2a327aa9c2b580f0 (diff)
parentfbc749a96e07dd1b1b5760cfe376b5b7838181f0 (diff)
downloadgitlab-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.rb19
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