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
6707bc56
Commit
6707bc56
authored
Aug 11, 2020
by
Dallas Reedy
Committed by
charlie ablett
Aug 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for instance_review_permitted?
parent
126bb14e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
ee/spec/helpers/application_helper_spec.rb
ee/spec/helpers/application_helper_spec.rb
+26
-0
No files found.
ee/spec/helpers/application_helper_spec.rb
View file @
6707bc56
...
...
@@ -189,6 +189,32 @@ RSpec.describe ApplicationHelper do
end
end
describe
'#instance_review_permitted?'
do
let_it_be
(
:non_admin_user
)
{
create
:user
}
let_it_be
(
:admin_user
)
{
create
:user
,
:admin
}
before
do
allow
(
::
Gitlab
::
CurrentSettings
).
to
receive
(
:instance_review_permitted?
).
and_return
(
app_setting
)
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
current_user
)
end
subject
{
helper
.
instance_review_permitted?
}
where
(
app_setting:
[
true
,
false
],
is_admin:
[
true
,
false
,
nil
])
with_them
do
let
(
:current_user
)
do
if
is_admin
.
nil?
nil
else
is_admin
?
admin_user
:
non_admin_user
end
end
it
{
is_expected
.
to
be
(
app_setting
&&
is_admin
)
}
end
end
describe
'#show_whats_new_dropdown_item?'
do
using
RSpec
::
Parameterized
::
TableSyntax
...
...
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