Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1182bf4e
Commit
1182bf4e
authored
Jan 29, 2020
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect trial query parameters
parent
a5f3d391
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
ee/app/controllers/trial_registrations_controller.rb
ee/app/controllers/trial_registrations_controller.rb
+4
-2
ee/spec/controllers/trial_registrations_controller_spec.rb
ee/spec/controllers/trial_registrations_controller_spec.rb
+8
-0
No files found.
ee/app/controllers/trial_registrations_controller.rb
View file @
1182bf4e
...
...
@@ -17,10 +17,12 @@ class TrialRegistrationsController < RegistrationsController
private
def
set_redirect_url
target_url
=
new_trial_url
(
params:
request
.
query_parameters
)
if
user_signed_in?
redirect_to
new_trial
_url
redirect_to
target
_url
else
store_location_for
(
:user
,
new_trial
_url
)
store_location_for
(
:user
,
target
_url
)
end
end
...
...
ee/spec/controllers/trial_registrations_controller_spec.rb
View file @
1182bf4e
...
...
@@ -20,6 +20,14 @@ describe TrialRegistrationsController do
expect
(
response
).
to
redirect_to
(
new_trial_url
)
end
it
'redirect keeps the query string parameters'
do
get_params
=
{
glm_source:
'some_source'
,
glm_content:
'some_content'
}
get
:new
,
params:
get_params
expect
(
response
).
to
redirect_to
(
new_trial_url
(
get_params
))
end
end
context
'when customer is not authenticated'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment