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
Tatuya Kamada
gitlab-ce
Commits
002d3a3e
Commit
002d3a3e
authored
Mar 06, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test case for the avaiable project keys
parent
55b07533
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
spec/presenters/projects/settings/deploy_keys_presenter_spec.rb
...resenters/projects/settings/deploy_keys_presenter_spec.rb
+11
-4
No files found.
spec/presenters/projects/settings/deploy_keys_presenter_spec.rb
View file @
002d3a3e
...
@@ -36,20 +36,27 @@ describe Projects::Settings::DeployKeysPresenter do
...
@@ -36,20 +36,27 @@ describe Projects::Settings::DeployKeysPresenter do
end
end
describe
'#available_keys/#available_project_keys'
do
describe
'#available_keys/#available_project_keys'
do
let
(
:other_deploy_key
)
{
create
(
:another_deploy_key
)
}
before
do
project_key
=
create
(
:deploy_keys_project
,
deploy_key:
other_deploy_key
)
project_key
.
project
.
add_developer
(
user
)
end
it
'returns the current available_keys'
do
it
'returns the current available_keys'
do
expect
(
presenter
.
available_keys
).
to
be_empty
expect
(
presenter
.
available_keys
).
not_
to
be_empty
end
end
it
'returns the current available_project_keys'
do
it
'returns the current available_project_keys'
do
expect
(
presenter
.
available_project_keys
).
to
be_empty
expect
(
presenter
.
available_project_keys
).
not_
to
be_empty
end
end
it
'returns false if any available_project_keys are enabled'
do
it
'returns false if any available_project_keys are enabled'
do
expect
(
presenter
.
any_available_project_keys_enabled?
).
to
eq
(
fals
e
)
expect
(
presenter
.
any_available_project_keys_enabled?
).
to
eq
(
tru
e
)
end
end
it
'returns the available_project_keys size'
do
it
'returns the available_project_keys size'
do
expect
(
presenter
.
available_project_keys_size
).
to
eq
(
0
)
expect
(
presenter
.
available_project_keys_size
).
to
eq
(
1
)
end
end
it
'shows if there is an available key'
do
it
'shows if there is an available key'
do
...
...
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