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
Léo-Paul Géneau
gitlab-ce
Commits
8c276580
Commit
8c276580
authored
Apr 06, 2018
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes deploy tokens presenter
parent
29913816
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
37 deletions
+2
-37
app/controllers/projects/settings/repository_controller.rb
app/controllers/projects/settings/repository_controller.rb
+1
-1
app/presenters/projects/settings/deploy_tokens_presenter.rb
app/presenters/projects/settings/deploy_tokens_presenter.rb
+0
-19
app/services/deploy_tokens/create_service.rb
app/services/deploy_tokens/create_service.rb
+1
-1
spec/presenters/projects/settings/deploy_tokens_presenter_spec.rb
...senters/projects/settings/deploy_tokens_presenter_spec.rb
+0
-16
No files found.
app/controllers/projects/settings/repository_controller.rb
View file @
8c276580
...
@@ -21,7 +21,7 @@ module Projects
...
@@ -21,7 +21,7 @@ module Projects
def
render_show
def
render_show
@deploy_keys
=
DeployKeysPresenter
.
new
(
@project
,
current_user:
current_user
)
@deploy_keys
=
DeployKeysPresenter
.
new
(
@project
,
current_user:
current_user
)
@deploy_tokens
=
DeployTokensPresenter
.
new
(
@project
.
deploy_tokens
.
active
,
current_user:
current_user
,
project:
project
)
@deploy_tokens
=
@project
.
deploy_tokens
.
active
define_deploy_token
define_deploy_token
define_protected_refs
define_protected_refs
...
...
app/presenters/projects/settings/deploy_tokens_presenter.rb
deleted
100644 → 0
View file @
29913816
module
Projects
module
Settings
class
DeployTokensPresenter
<
Gitlab
::
View
::
Presenter
::
Simple
include
Enumerable
presents
:deploy_tokens
def
length
deploy_tokens
.
length
end
def
each
deploy_tokens
.
each
do
|
deploy_token
|
yield
deploy_token
end
end
end
end
end
app/services/deploy_tokens/create_service.rb
View file @
8c276580
...
@@ -12,7 +12,7 @@ module DeployTokens
...
@@ -12,7 +12,7 @@ module DeployTokens
end
end
def
expires_at_date
def
expires_at_date
params
[
:expires_at
].
presen
t?
?
default_expires_at
:
params
[
:expires_at
]
params
[
:expires_at
].
presen
ce
||
default_expires_at
end
end
def
default_expires_at
def
default_expires_at
...
...
spec/presenters/projects/settings/deploy_tokens_presenter_spec.rb
deleted
100644 → 0
View file @
29913816
require
'spec_helper'
describe
Projects
::
Settings
::
DeployTokensPresenter
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:project_deploy_tokens
)
{
create_list
(
:project_deploy_token
,
3
,
project:
project
)
}
let
(
:deploy_tokens
)
{
project
.
deploy_tokens
}
subject
(
:presenter
)
{
described_class
.
new
(
deploy_tokens
,
current_user:
user
,
project:
project
)
}
describe
'#length'
do
it
'returns the size of deploy tokens presented'
do
expect
(
presenter
.
length
).
to
eq
(
3
)
end
end
end
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