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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
277e9e4e
Commit
277e9e4e
authored
Jul 26, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for access_for_user_ids
parent
a85d24fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
spec/models/member_spec.rb
spec/models/member_spec.rb
+12
-0
No files found.
spec/models/member_spec.rb
View file @
277e9e4e
...
...
@@ -79,6 +79,18 @@ describe Member, models: true do
@accepted_request_member
=
project
.
requesters
.
find_by
(
user_id:
accepted_request_user
.
id
).
tap
{
|
m
|
m
.
accept_request
}
end
describe
'.access_for_user_ids'
do
it
'returns the right access levels'
do
users
=
[
@owner_user
.
id
,
@master_user
.
id
]
expected
=
{
@owner_user
.
id
=>
Gitlab
::
Access
::
OWNER
,
@master_user
.
id
=>
Gitlab
::
Access
::
MASTER
}
expect
(
described_class
.
access_for_user_ids
(
users
)).
to
eq
(
expected
)
end
end
describe
'.invite'
do
it
{
expect
(
described_class
.
invite
).
not_to
include
@master
}
it
{
expect
(
described_class
.
invite
).
to
include
@invited_member
}
...
...
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