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
22ccc1d7
Commit
22ccc1d7
authored
Apr 06, 2022
by
jejacks0n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves the expect_next spec implementation
parent
65836d5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
30 deletions
+28
-30
ee/spec/features/registrations/saas_user_registration_spec.rb
...pec/features/registrations/saas_user_registration_spec.rb
+28
-30
No files found.
ee/spec/features/registrations/saas_user_registration_spec.rb
View file @
22ccc1d7
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
RSpec
.
describe
"User registration"
,
:js
,
:saas
do
include
AfterNextHelpers
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
...
...
@@ -155,24 +157,22 @@ RSpec.describe "User registration", :js, :saas do
before
do
click_button
class:
'gl-toggle'
expect_next_instance_of
(
GitlabSubscriptions
::
CreateLeadService
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
).
with
(
trial_user:
ActionController
::
Parameters
.
new
(
company_name:
''
,
company_size:
''
,
phone_number:
''
,
country:
''
,
website_url:
''
,
work_email:
user
.
email
,
uid:
user
.
id
,
setup_for_company:
true
,
skip_email_confirmation:
true
,
gitlab_com_trial:
true
,
provider:
'gitlab'
,
newsletter_segment:
true
).
permit!
).
and_return
(
success:
true
)
end
expect_next
(
GitlabSubscriptions
::
CreateLeadService
).
to
receive
(
:execute
).
with
(
trial_user:
ActionController
::
Parameters
.
new
(
company_name:
''
,
company_size:
''
,
phone_number:
''
,
country:
''
,
website_url:
''
,
work_email:
user
.
email
,
uid:
user
.
id
,
setup_for_company:
true
,
skip_email_confirmation:
true
,
gitlab_com_trial:
true
,
provider:
'gitlab'
,
newsletter_segment:
true
).
permit!
).
and_return
(
success:
true
)
click_on
'Continue'
end
...
...
@@ -183,18 +183,16 @@ RSpec.describe "User registration", :js, :saas do
fill_in
'group_name'
,
with:
'Test Group'
fill_in
'blank_project_name'
,
with:
'Test Project'
expect_next_instance_of
(
GitlabSubscriptions
::
CreateLeadService
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
).
with
(
uid:
user
.
id
,
trial_user:
ActionController
::
Parameters
.
new
(
namespace_id:
Namespace
.
maximum
(
:id
).
to_i
+
1
,
trial_entity:
'company'
,
gitlab_com_trial:
true
,
sync_to_gl:
true
).
permit!
).
and_return
(
success:
true
)
end
expect_next
(
GitlabSubscriptions
::
CreateLeadService
).
to
receive
(
:execute
).
with
(
uid:
user
.
id
,
trial_user:
ActionController
::
Parameters
.
new
(
namespace_id:
Namespace
.
maximum
(
:id
).
to_i
+
1
,
trial_entity:
'company'
,
gitlab_com_trial:
true
,
sync_to_gl:
true
).
permit!
).
and_return
(
success:
true
)
click_on
'Create project'
...
...
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