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
1292c158
Commit
1292c158
authored
Jan 23, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CI Variable presenters paths
parent
2592aec9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
40 deletions
+14
-40
app/presenters/ci/group_variable_presenter.rb
app/presenters/ci/group_variable_presenter.rb
+3
-7
app/presenters/ci/variable_presenter.rb
app/presenters/ci/variable_presenter.rb
+3
-7
spec/presenters/ci/group_variable_presenter_spec.rb
spec/presenters/ci/group_variable_presenter_spec.rb
+4
-13
spec/presenters/ci/variable_presenter_spec.rb
spec/presenters/ci/variable_presenter_spec.rb
+4
-13
No files found.
app/presenters/ci/group_variable_presenter.rb
View file @
1292c158
...
...
@@ -7,19 +7,15 @@ module Ci
end
def
form_path
if
variable
.
persisted?
group_variable_path
(
group
,
variable
)
else
group_variables_path
(
group
)
end
group_settings_ci_cd_path
(
group
)
end
def
edit_path
group_variable
_path
(
group
,
variable
)
group_variable
s_save_multiple_path
(
group
)
end
def
delete_path
group_variable
_path
(
group
,
variable
)
group_variable
s_save_multiple_path
(
group
)
end
end
end
app/presenters/ci/variable_presenter.rb
View file @
1292c158
...
...
@@ -7,19 +7,15 @@ module Ci
end
def
form_path
if
variable
.
persisted?
project_variable_path
(
project
,
variable
)
else
project_variables_path
(
project
)
end
project_settings_ci_cd_path
(
project
)
end
def
edit_path
project_variable
_path
(
project
,
variable
)
project_variable
s_save_multiple_path
(
project
)
end
def
delete_path
project_variable
_path
(
project
,
variable
)
project_variable
s_save_multiple_path
(
project
)
end
end
end
spec/presenters/ci/group_variable_presenter_spec.rb
View file @
1292c158
...
...
@@ -35,29 +35,20 @@ describe Ci::GroupVariablePresenter do
end
describe
'#form_path'
do
context
'when variable is persisted'
do
subject
{
described_class
.
new
(
variable
).
form_path
}
subject
{
described_class
.
new
(
variable
).
form_path
}
it
{
is_expected
.
to
eq
(
group_variable_path
(
group
,
variable
))
}
end
context
'when variable is not persisted'
do
let
(
:variable
)
{
build
(
:ci_group_variable
,
group:
group
)
}
subject
{
described_class
.
new
(
variable
).
form_path
}
it
{
is_expected
.
to
eq
(
group_variables_path
(
group
))
}
end
it
{
is_expected
.
to
eq
(
group_settings_ci_cd_path
(
group
))
}
end
describe
'#edit_path'
do
subject
{
described_class
.
new
(
variable
).
edit_path
}
it
{
is_expected
.
to
eq
(
group_variable
_path
(
group
,
variable
))
}
it
{
is_expected
.
to
eq
(
group_variable
s_save_multiple_path
(
group
))
}
end
describe
'#delete_path'
do
subject
{
described_class
.
new
(
variable
).
delete_path
}
it
{
is_expected
.
to
eq
(
group_variable
_path
(
group
,
variable
))
}
it
{
is_expected
.
to
eq
(
group_variable
s_save_multiple_path
(
group
))
}
end
end
spec/presenters/ci/variable_presenter_spec.rb
View file @
1292c158
...
...
@@ -35,29 +35,20 @@ describe Ci::VariablePresenter do
end
describe
'#form_path'
do
context
'when variable is persisted'
do
subject
{
described_class
.
new
(
variable
).
form_path
}
subject
{
described_class
.
new
(
variable
).
form_path
}
it
{
is_expected
.
to
eq
(
project_variable_path
(
project
,
variable
))
}
end
context
'when variable is not persisted'
do
let
(
:variable
)
{
build
(
:ci_variable
,
project:
project
)
}
subject
{
described_class
.
new
(
variable
).
form_path
}
it
{
is_expected
.
to
eq
(
project_variables_path
(
project
))
}
end
it
{
is_expected
.
to
eq
(
project_settings_ci_cd_path
(
project
))
}
end
describe
'#edit_path'
do
subject
{
described_class
.
new
(
variable
).
edit_path
}
it
{
is_expected
.
to
eq
(
project_variable
_path
(
project
,
variable
))
}
it
{
is_expected
.
to
eq
(
project_variable
s_save_multiple_path
(
project
))
}
end
describe
'#delete_path'
do
subject
{
described_class
.
new
(
variable
).
delete_path
}
it
{
is_expected
.
to
eq
(
project_variable
_path
(
project
,
variable
))
}
it
{
is_expected
.
to
eq
(
project_variable
s_save_multiple_path
(
project
))
}
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