diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-24 07:52:21 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-24 07:52:21 +0000 |
commit | f7bdfe5098c9a5a3a426344ba1d7dd668212cf7e (patch) | |
tree | 5a1cb2a90b0a2b5114f6f23712b68724b3e8a7e0 /spec/controllers/application_controller_spec.rb | |
parent | 9cd528aa7ac5066570cb50b909951a6c6b723935 (diff) | |
parent | e16add2267648d3d3ef1d98f9b53f67a29428791 (diff) | |
download | gitlab-ce-es-module-autosave.tar.gz |
Merge branch 'master' into 'es-module-autosave'es-module-autosave
# Conflicts:
# app/assets/javascripts/issuable_form.js
# app/assets/javascripts/notes.js
Diffstat (limited to 'spec/controllers/application_controller_spec.rb')
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 59a6cfbf4f5..6802b839eaa 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -61,7 +61,7 @@ describe ApplicationController do context "when the 'private_token' param is populated with the private token" do it "logs the user in" do get :index, private_token: user.private_token - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.body).to eq("authenticated") end end @@ -70,7 +70,7 @@ describe ApplicationController do it "logs the user in" do @request.headers['PRIVATE-TOKEN'] = user.private_token get :index - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.body).to eq("authenticated") end end @@ -95,7 +95,7 @@ describe ApplicationController do context "when the 'personal_access_token' param is populated with the personal access token" do it "logs the user in" do get :index, private_token: personal_access_token.token - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.body).to eq('authenticated') end end @@ -104,7 +104,7 @@ describe ApplicationController do it "logs the user in" do @request.headers["PRIVATE-TOKEN"] = personal_access_token.token get :index - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.body).to eq('authenticated') end end @@ -158,7 +158,7 @@ describe ApplicationController do it 'returns 200 response' do get :index, private_token: user.private_token, format: requested_format - expect(response).to have_http_status 200 + expect(response).to have_gitlab_http_status 200 end end @@ -166,7 +166,7 @@ describe ApplicationController do it 'returns 404 response' do get :index, private_token: user.private_token - expect(response).to have_http_status 404 + expect(response).to have_gitlab_http_status 404 end end end @@ -183,7 +183,7 @@ describe ApplicationController do context 'when the request format is atom' do it "logs the user in" do get :index, rss_token: user.rss_token, format: :atom - expect(response).to have_http_status 200 + expect(response).to have_gitlab_http_status 200 expect(response.body).to eq 'authenticated' end end @@ -191,7 +191,7 @@ describe ApplicationController do context 'when the request format is not atom' do it "doesn't log the user in" do get :index, rss_token: user.rss_token - expect(response.status).not_to have_http_status 200 + expect(response.status).not_to have_gitlab_http_status 200 expect(response.body).not_to eq 'authenticated' end end @@ -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 } |