summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-29 19:31:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-29 19:31:31 +0000
commite810b8327513c3b07cb779dbce6c75dbcb49ca84 (patch)
tree65b220240faa9e191388c6ab233fed03da2b8713 /spec/support
parent11e9b7b58837da351f08c18e6f0f4faba4d7d301 (diff)
downloadgitlab-ce-e810b8327513c3b07cb779dbce6c75dbcb49ca84.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb42
1 files changed, 7 insertions, 35 deletions
diff --git a/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb b/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
index c128bbe5e02..b5f2c0d07bf 100644
--- a/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
@@ -158,46 +158,18 @@ RSpec.shared_examples 'wiki controller actions' do
context 'when page is a file' do
include WikiHelpers
- let(:id) { upload_file_to_wiki(container, user, file_name) }
+ where(:file_name) { ['dk.png', 'unsanitized.svg', 'git-cheat-sheet.pdf'] }
- context 'when file is an image' do
- let(:file_name) { 'dk.png' }
+ with_them do
+ let(:id) { upload_file_to_wiki(container, user, file_name) }
- it 'delivers the image' do
+ it 'delivers the file with the correct headers' do
subject
expect(response.headers['Content-Disposition']).to match(/^inline/)
- expect(response.headers[Gitlab::Workhorse::DETECT_HEADER]).to eq "true"
- end
-
- context 'when file is a svg' do
- let(:file_name) { 'unsanitized.svg' }
-
- it 'delivers the image' do
- subject
-
- expect(response.headers['Content-Disposition']).to match(/^inline/)
- expect(response.headers[Gitlab::Workhorse::DETECT_HEADER]).to eq "true"
- end
- end
-
- it_behaves_like 'project cache control headers' do
- let(:project) { container }
- end
- end
-
- context 'when file is a pdf' do
- let(:file_name) { 'git-cheat-sheet.pdf' }
-
- it 'sets the content type to sets the content response headers' do
- subject
-
- expect(response.headers['Content-Disposition']).to match(/^inline/)
- expect(response.headers[Gitlab::Workhorse::DETECT_HEADER]).to eq "true"
- end
-
- it_behaves_like 'project cache control headers' do
- let(:project) { container }
+ expect(response.headers[Gitlab::Workhorse::DETECT_HEADER]).to eq('true')
+ expect(response.cache_control[:public]).to be(false)
+ expect(response.cache_control[:extras]).to include('no-store')
end
end
end