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
26aa54ac
Commit
26aa54ac
authored
May 24, 2021
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restrict trial during free signup to company users
Changelog: added
parent
3701748a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
3 deletions
+40
-3
ee/app/helpers/ee/welcome_helper.rb
ee/app/helpers/ee/welcome_helper.rb
+4
-0
ee/app/views/registrations/groups/new.html.haml
ee/app/views/registrations/groups/new.html.haml
+1
-1
ee/spec/features/registrations/group_invites_during_signup_flow_spec.rb
...es/registrations/group_invites_during_signup_flow_spec.rb
+1
-1
ee/spec/features/registrations/trial_during_signup_flow_spec.rb
...c/features/registrations/trial_during_signup_flow_spec.rb
+1
-1
ee/spec/helpers/ee/welcome_helper_spec.rb
ee/spec/helpers/ee/welcome_helper_spec.rb
+19
-0
ee/spec/views/registrations/groups/new.html.haml_spec.rb
ee/spec/views/registrations/groups/new.html.haml_spec.rb
+14
-0
No files found.
ee/app/helpers/ee/welcome_helper.rb
View file @
26aa54ac
...
...
@@ -16,6 +16,10 @@ module EE
params
[
:trial_onboarding_flow
]
==
'true'
end
def
show_trial_during_signup?
current_user
.
setup_for_company
end
def
in_trial_during_signup_flow?
params
[
:trial
]
==
'true'
end
...
...
ee/app/views/registrations/groups/new.html.haml
View file @
26aa54ac
...
...
@@ -41,7 +41,7 @@
.row
.form-group.col-sm-12
=
render
partial:
'shared/groups/visibility_level'
,
locals:
{
f:
f
}
-
if
!
in_trial_onboarding_flow?
-
if
!
in_trial_onboarding_flow?
&&
show_trial_during_signup?
=
render
partial:
'shared/groups/trial_form'
-
else
-
experiment
(
:registrations_group_invite
,
actor:
current_user
)
do
|
experiment_instance
|
...
...
ee/spec/features/registrations/group_invites_during_signup_flow_spec.rb
View file @
26aa54ac
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
'User is able to invite members to group during signup'
,
:js
,
:experiment
do
include
Select2Helper
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
,
setup_for_company:
true
)
}
let
(
:path_params
)
{
{}
}
before
do
...
...
ee/spec/features/registrations/trial_during_signup_flow_spec.rb
View file @
26aa54ac
...
...
@@ -16,7 +16,7 @@ RSpec.describe 'User sees new onboarding flow', :js do
expect
(
page
).
to
have_content
(
'Welcome to GitLab'
)
choose
'
Just me
'
choose
'
My company or team
'
click_on
'Continue'
expect
(
page
).
to
have_content
(
'GitLab Ultimate trial (optional)'
)
...
...
ee/spec/helpers/ee/welcome_helper_spec.rb
View file @
26aa54ac
...
...
@@ -37,6 +37,25 @@ RSpec.describe EE::WelcomeHelper do
end
end
describe
'#show_trial_during_signup?'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
where
(
:setup_for_company
,
:expected_result
)
do
true
|
true
false
|
false
end
with_them
do
let
(
:user
)
{
create
(
:user
,
setup_for_company:
setup_for_company
)
}
it
'returns the expected_result'
do
expect
(
helper
.
show_trial_during_signup?
).
to
eq
(
expected_result
)
end
end
end
describe
'#in_oauth_flow?'
do
where
(
:user_return_to_path
,
:expected_result
)
do
'/oauth/authorize?client_id=x&redirect_uri=y&response_type=code&state=z'
|
true
...
...
ee/spec/views/registrations/groups/new.html.haml_spec.rb
View file @
26aa54ac
...
...
@@ -6,11 +6,13 @@ RSpec.describe 'registrations/groups/new' do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:trial_onboarding_flow
)
{
false
}
let_it_be
(
:show_trial_during_signup
)
{
true
}
before
do
assign
(
:group
,
group
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:in_trial_onboarding_flow?
).
and_return
(
trial_onboarding_flow
)
allow
(
view
).
to
receive
(
:show_trial_during_signup?
).
and_return
(
show_trial_during_signup
)
render
end
...
...
@@ -26,6 +28,10 @@ RSpec.describe 'registrations/groups/new' do
expect
(
rendered
).
to
have_selector
(
'#progress-bar'
)
end
it
'shows the trial during signup form'
do
expect
(
rendered
).
to
have_content
(
'GitLab Ultimate trial (optional)'
)
end
context
'in trial onboarding'
do
let_it_be
(
:trial_onboarding_flow
)
{
true
}
...
...
@@ -38,4 +44,12 @@ RSpec.describe 'registrations/groups/new' do
expect
(
rendered
).
not_to
have_selector
(
'#progress-bar'
)
end
end
context
'not showing trial during signup'
do
let_it_be
(
:show_trial_during_signup
)
{
false
}
it
'shows the trial during signup form'
do
expect
(
rendered
).
not_to
have_content
(
'GitLab Ultimate trial (optional)'
)
end
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