Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2017-10-20 19:44:30 +0300
committerWinnie Hellmann <winnie@gitlab.com>2017-10-20 19:56:39 +0300
commit1652288f65547e352f50312d2457dffd20db423c (patch)
tree59c4de90489d7577978b5adc4e41ba833ea55522 /spec
parenta0fc7c48226cd54715029a0cc2ad45335fee384a (diff)
Merge branch 'tc-page-title-encoding-fix' into 'master'
URI decode Page-Title header to preserve UTF-8 characters Closes #39179 (cherry-picked from 85c201603ab856fbe5129aa231ab069ffd73d769) See merge request gitlab-org/gitlab-ce!14929
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/application_controller_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 59a6cfbf4f5..0a3a0f7da18 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -221,6 +221,20 @@ describe ApplicationController do
end
end
+ describe '#set_page_title_header' do
+ let(:controller) { described_class.new }
+
+ it 'URI encodes UTF-8 characters in the title' do
+ response = double(headers: {})
+ allow_any_instance_of(PageLayoutHelper).to receive(:page_title).and_return('€100 · GitLab')
+ allow(controller).to receive(:response).and_return(response)
+
+ controller.send(:set_page_title_header)
+
+ expect(response.headers['Page-Title']).to eq('%E2%82%AC100%20%C2%B7%20GitLab')
+ end
+ end
+
context 'two-factor authentication' do
let(:controller) { described_class.new }