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
diff options
context:
space:
mode:
authormhasbini <mohammad.hasbini@gmail.com>2017-04-02 18:54:19 +0300
committermhasbini <mohammad.hasbini@gmail.com>2017-04-02 18:54:19 +0300
commitaf0c08b6f92a0933e24414bea11344162cda6c43 (patch)
treec56dcf4da3586922629def06f3962f667db6facb /spec/controllers/sessions_controller_spec.rb
parent9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff)
Fix redirection after login when the referer have params
Diffstat (limited to 'spec/controllers/sessions_controller_spec.rb')
-rw-r--r--spec/controllers/sessions_controller_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb
index a06c29dd91a..9c16a7bc08b 100644
--- a/spec/controllers/sessions_controller_spec.rb
+++ b/spec/controllers/sessions_controller_spec.rb
@@ -211,4 +211,20 @@ describe SessionsController do
end
end
end
+
+ describe '#new' do
+ before do
+ @request.env['devise.mapping'] = Devise.mappings[:user]
+ end
+
+ it 'redirects correctly for referer on same host with params' do
+ search_path = '/search?search=seed_project'
+ allow(controller.request).to receive(:referer).
+ and_return('http://%{host}%{path}' % { host: Gitlab.config.gitlab.host, path: search_path })
+
+ get(:new, redirect_to_referer: :yes)
+
+ expect(controller.stored_location_for(:redirect)).to eq(search_path)
+ end
+ end
end