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
3a1c8031
Verified
Commit
3a1c8031
authored
3 months ago
by
Angelo Gulina
Committed by
GitLab
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Update specs for #show_active_user_count_threshold_banner?
parent
d9182531
No related branches found
No related tags found
1 merge request
!171512
Update specs for #show_active_user_count_threshold_banner?
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ee/spec/helpers/license_monitoring_helper_spec.rb
+58
-4
58 additions, 4 deletions
ee/spec/helpers/license_monitoring_helper_spec.rb
with
58 additions
and
4 deletions
ee/spec/helpers/license_monitoring_helper_spec.rb
+
58
−
4
View file @
3a1c8031
...
...
@@ -8,10 +8,6 @@
let
(
:user
)
{
build_stubbed
(
:user
)
}
let
(
:license
)
{
build_stubbed
(
:gitlab_license
)
}
before
do
stub_feature_flags
(
sm_seat_control_block_overages:
false
)
end
describe
'#show_active_user_count_threshold_banner?'
do
subject
{
helper
.
show_active_user_count_threshold_banner?
}
...
...
@@ -50,9 +46,67 @@
.
and_return
(
license_active_user_count_threshold_reached
)
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
end
stub_feature_flags
(
sm_seat_control_block_overages:
false
)
end
it
{
is_expected
.
to
be
should_render
}
context
"when sm_seat_control_block_overages is enabled"
do
before
do
stub_feature_flags
(
sm_seat_control_block_overages:
true
)
end
it
{
is_expected
.
to
be_nil
}
end
end
end
describe
'#show_block_seat_overages_user_count_banner?'
do
subject
{
helper
.
show_block_seat_overages_user_count_banner?
}
where
(
:dot_com
,
:admin_section
,
:license_nil
,
:user_can_admin_all_resources
,
:license_active_user_count_threshold_reached
,
:should_render
)
do
false
|
true
|
false
|
true
|
true
|
true
# Happy Path
true
|
true
|
false
|
true
|
true
|
nil
# ::Gitlab.com? is true
false
|
false
|
false
|
true
|
true
|
nil
# admin_section is false
false
|
true
|
true
|
true
|
true
|
nil
# license is nil
false
|
true
|
false
|
false
|
true
|
false
# user_can_admin_all_resources is false
false
|
true
|
false
|
true
|
false
|
false
# license_active_user_count_threshold_reached is false
end
with_them
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
dot_com
)
allow
(
helper
).
to
receive
(
:admin_section?
).
and_return
(
admin_section
)
allow
(
user
).
to
receive
(
:can_admin_all_resources?
).
and_return
(
user_can_admin_all_resources
)
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
if
license_nil
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
else
allow
(
license
).
to
receive
(
:active_user_count_threshold_reached?
)
.
and_return
(
license_active_user_count_threshold_reached
)
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
end
end
it
{
is_expected
.
to
be
should_render
}
context
"when sm_seat_control_block_overages is disabled"
do
before
do
stub_feature_flags
(
sm_seat_control_block_overages:
false
)
end
it
{
is_expected
.
to
be_nil
}
end
end
end
...
...
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