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
bc7d9ce2
Commit
bc7d9ce2
authored
Sep 18, 2019
by
Aishwarya Subramanian
Committed by
James Lopez
Sep 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling new trials redirect when feature is off
parent
6c37e8a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
ee/app/controllers/trial_registrations_controller.rb
ee/app/controllers/trial_registrations_controller.rb
+3
-1
ee/spec/controllers/trial_registrations_controller_spec.rb
ee/spec/controllers/trial_registrations_controller_spec.rb
+19
-1
No files found.
ee/app/controllers/trial_registrations_controller.rb
View file @
bc7d9ce2
...
...
@@ -41,6 +41,8 @@ class TrialRegistrationsController < RegistrationsController
end
def
check_if_improved_trials_enabled
render_404
unless
Feature
.
enabled?
(
:improved_trial_signup
)
unless
Feature
.
enabled?
(
:improved_trial_signup
)
redirect_to
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/trials/new?gl_com=true"
)
end
end
end
ee/spec/controllers/trial_registrations_controller_spec.rb
View file @
bc7d9ce2
...
...
@@ -3,6 +3,24 @@
require
'spec_helper'
describe
TrialRegistrationsController
do
describe
'#new'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
end
context
'when feature is turned off'
do
before
do
stub_feature_flags
(
improved_trial_signup:
false
)
end
it
'redirects to subscription portal trial url'
do
get
:new
expect
(
response
).
to
redirect_to
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/trials/new?gl_com=true"
)
end
end
end
describe
'#create'
do
before
do
stub_feature_flags
(
invisible_captcha:
false
)
...
...
@@ -40,7 +58,7 @@ describe TrialRegistrationsController do
it
'returns not found'
do
post
:create
,
params:
{
user:
user_params
}
expect
(
response
.
status
).
to
eq
(
404
)
expect
(
response
).
to
redirect_to
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/trials/new?gl_com=true"
)
end
end
...
...
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