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
fbd5a6c6
Commit
fbd5a6c6
authored
Aug 02, 2019
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for User#accessible_deploy_keys
parent
d3a3db42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+18
-0
No files found.
spec/models/user_spec.rb
View file @
fbd5a6c6
...
@@ -794,6 +794,24 @@ describe User do
...
@@ -794,6 +794,24 @@ describe User do
end
end
end
end
describe
'#accessible_deploy_keys'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:private_deploy_keys_project
)
{
create
(
:deploy_keys_project
)
}
let!
(
:public_deploy_keys_project
)
{
create
(
:deploy_keys_project
)
}
let!
(
:accessible_deploy_keys_project
)
{
create
(
:deploy_keys_project
,
project:
project
)
}
before
do
public_deploy_keys_project
.
deploy_key
.
update
(
public:
true
)
project
.
add_developer
(
user
)
end
it
'user can only see deploy keys accessible to right projects'
do
expect
(
user
.
accessible_deploy_keys
).
to
match_array
([
public_deploy_keys_project
.
deploy_key
,
accessible_deploy_keys_project
.
deploy_key
])
end
end
describe
'#deploy_keys'
do
describe
'#deploy_keys'
do
include_context
'user keys'
include_context
'user keys'
...
...
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