Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
6d99a0b6
Commit
6d99a0b6
authored
6 years ago
by
Yamagishi Kazutoshi
Committed by
Eugen Rochko
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests for invites controller (regression from
4d81809f
) (#7597)
parent
4d81809f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/controllers/invites_controller_spec.rb
+9
-4
9 additions, 4 deletions
spec/controllers/invites_controller_spec.rb
with
9 additions
and
4 deletions
spec/controllers/invites_controller_spec.rb
+
9
−
4
View file @
6d99a0b6
...
...
@@ -7,15 +7,21 @@ describe InvitesController do
sign_in
user
end
around
do
|
example
|
min_invite_role
=
Setting
.
min_invite_role
example
.
run
Setting
.
min_invite_role
=
min_invite_role
end
describe
'GET #index'
do
subject
{
get
:index
}
let
(
:user
)
{
Fabricate
(
:user
,
moderator:
false
,
admin:
false
)
}
let!
(
:invite
)
{
Fabricate
(
:invite
,
user:
user
)
}
context
'when user is a staff'
do
let
(
:user
)
{
Fabricate
(
:user
,
moderator:
true
,
admin:
false
)
}
it
'renders index page'
do
Setting
.
min_invite_role
=
'user'
expect
(
subject
).
to
render_template
:index
expect
(
assigns
(
:invites
)).
to
include
invite
expect
(
assigns
(
:invites
).
count
).
to
eq
1
...
...
@@ -23,9 +29,8 @@ describe InvitesController do
end
context
'when user is not a staff'
do
let
(
:user
)
{
Fabricate
(
:user
,
moderator:
false
,
admin:
false
)
}
it
'returns 403'
do
Setting
.
min_invite_role
=
'modelator'
expect
(
subject
).
to
have_http_status
403
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