Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
dfe017b1
Commit
dfe017b1
authored
3 months ago
by
mo khan
Browse files
Options
Downloads
Patches
Plain Diff
Use a FactoryBot trait to improve readability
parent
e045b5da
No related branches found
No related tags found
1 merge request
!174087
Use a FactoryBot trait to improve readability
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ee/spec/models/ee/group_spec.rb
+3
-3
3 additions, 3 deletions
ee/spec/models/ee/group_spec.rb
with
3 additions
and
3 deletions
ee/spec/models/ee/group_spec.rb
+
3
−
3
View file @
dfe017b1
...
...
@@ -3918,21 +3918,21 @@ def webhook_headers
end
it
'returns false when there are not enough seats if the custom role is billable'
do
custom_role
=
create
(
:member_role
,
base_access_level:
::
Gitlab
::
Access
::
GUEST
,
permissions:
{
remove_project
:
true
}
)
custom_role
=
create
(
:member_role
,
:guest
,
:
remove_project
)
user_ids
=
%w[1 2 3]
expect
(
group
.
seats_available_for?
(
user_ids
,
::
Gitlab
::
Access
::
GUEST
,
custom_role
.
id
)).
to
eq
(
false
)
end
it
'returns true even if there are not enough seats if the custom role is not billable'
do
custom_role
=
create
(
:member_role
,
base_access_level:
::
Gitlab
::
Access
::
GUEST
,
permissions:
{
read_code
:
true
}
)
custom_role
=
create
(
:member_role
,
:guest
,
:
read_code
)
user_ids
=
%w[1 2 3]
expect
(
group
.
seats_available_for?
(
user_ids
,
::
Gitlab
::
Access
::
GUEST
,
custom_role
.
id
)).
to
eq
(
true
)
end
it
'returns false when there are not enough seats if the custom role is billable and uses minimal access as its base'
do
custom_role
=
create
(
:member_role
,
base_access_level:
::
Gitlab
::
Access
::
MINIMAL_ACCESS
,
permissions:
{
remove_project
:
true
}
)
custom_role
=
create
(
:member_role
,
:minimal_access
,
:
remove_project
)
user_ids
=
%w[1 2 3]
expect
(
group
.
seats_available_for?
(
user_ids
,
::
Gitlab
::
Access
::
MINIMAL_ACCESS
,
custom_role
.
id
)).
to
eq
(
false
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment