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
d3d0c431
Commit
d3d0c431
authored
Oct 19, 2021
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Source & Content for hand raise & trial leads
parent
0b48a8a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+5
-3
ee/spec/controllers/trials_controller_spec.rb
ee/spec/controllers/trials_controller_spec.rb
+25
-4
No files found.
ee/app/controllers/trials_controller.rb
View file @
d3d0c431
...
@@ -111,13 +111,15 @@ class TrialsController < ApplicationController
...
@@ -111,13 +111,15 @@ class TrialsController < ApplicationController
work_email:
current_user
.
email
,
work_email:
current_user
.
email
,
uid:
current_user
.
id
,
uid:
current_user
.
id
,
provider:
'gitlab'
,
provider:
'gitlab'
,
setup_for_company:
current_user
.
setup_for_company
setup_for_company:
current_user
.
setup_for_company
,
glm_content:
'group-billing'
,
glm_source:
'gitlab.com'
}
}
end
end
def
company_params
def
company_params
params
.
permit
(
:company_name
,
:company_size
,
:first_name
,
:last_name
,
:phone_number
,
:number_of_users
,
:country
)
params
.
permit
(
:company_name
,
:company_size
,
:first_name
,
:last_name
,
:phone_number
,
.
merge
(
extra_params
)
:number_of_users
,
:country
,
:glm_content
,
:glm_source
)
.
merge
(
extra_params
)
end
end
def
extra_params
def
extra_params
...
...
ee/spec/controllers/trials_controller_spec.rb
View file @
d3d0c431
...
@@ -171,7 +171,9 @@ RSpec.describe TrialsController do
...
@@ -171,7 +171,9 @@ RSpec.describe TrialsController do
last_name:
user
.
last_name
,
last_name:
user
.
last_name
,
phone_number:
'1111111111'
,
phone_number:
'1111111111'
,
number_of_users:
'20'
,
number_of_users:
'20'
,
country:
'IN'
country:
'IN'
,
glm_content:
'free-billing'
,
glm_source:
'about.gitlab.com'
}
}
end
end
...
@@ -188,12 +190,29 @@ RSpec.describe TrialsController do
...
@@ -188,12 +190,29 @@ RSpec.describe TrialsController do
end
end
let
(
:expected_params
)
do
let
(
:expected_params
)
do
ActionController
::
Parameters
.
new
(
post_params
).
merge
(
extra_params
).
permit!
{
company_name:
'Gitlab'
,
company_size:
'1-99'
,
first_name:
user
.
first_name
,
last_name:
user
.
last_name
,
phone_number:
'1111111111'
,
number_of_users:
'20'
,
country:
'IN'
,
glm_content:
'free-billing'
,
glm_source:
'about.gitlab.com'
,
work_email:
user
.
email
,
uid:
user
.
id
,
setup_for_company:
nil
,
skip_email_confirmation:
true
,
gitlab_com_trial:
true
,
provider:
'gitlab'
,
newsletter_segment:
user
.
email_opted_in
}
end
end
it
'sends appropriate request params'
do
it
'sends appropriate request params'
do
expect_next_instance_of
(
GitlabSubscriptions
::
CreateLeadService
)
do
|
lead_service
|
expect_next_instance_of
(
GitlabSubscriptions
::
CreateLeadService
)
do
|
lead_service
|
expect
(
lead_service
).
to
receive
(
:execute
).
with
({
trial_user:
expected_params
}).
and_return
({
success:
true
})
expect
(
lead_service
).
to
receive
(
:execute
).
with
({
trial_user:
ActionController
::
Parameters
.
new
(
expected_params
).
permit!
}).
and_return
({
success:
true
})
end
end
post_create_lead
post_create_lead
...
@@ -211,7 +230,9 @@ RSpec.describe TrialsController do
...
@@ -211,7 +230,9 @@ RSpec.describe TrialsController do
work_email:
user
.
email
,
work_email:
user
.
email
,
uid:
user
.
id
,
uid:
user
.
id
,
provider:
'gitlab'
,
provider:
'gitlab'
,
setup_for_company:
user
.
setup_for_company
setup_for_company:
user
.
setup_for_company
,
glm_content:
'group-billing'
,
glm_source:
'gitlab.com'
}
}
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