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
b7d17aab
Commit
b7d17aab
authored
Jul 06, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new project_variables_path in this MR
parent
8c434a52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+3
-3
app/presenters/ci/variable_presenter.rb
app/presenters/ci/variable_presenter.rb
+2
-2
spec/presenters/ci/variable_presenter_spec.rb
spec/presenters/ci/variable_presenter_spec.rb
+4
-4
No files found.
app/controllers/projects/variables_controller.rb
View file @
b7d17aab
...
...
@@ -5,7 +5,7 @@ class Projects::VariablesController < Projects::ApplicationController
layout
'project_settings'
def
index
redirect_to
namespace_project_settings_ci_cd_path
(
@project
.
namespace
,
@project
)
redirect_to
project_settings_ci_cd_path
(
@project
)
end
def
show
...
...
@@ -34,11 +34,11 @@ class Projects::VariablesController < Projects::ApplicationController
def
destroy
if
variable
.
destroy
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
redirect_to
project_settings_ci_cd_path
(
project
),
status:
302
,
notice:
'Variable was successfully removed.'
else
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
redirect_to
project_settings_ci_cd_path
(
project
),
status:
302
,
notice:
'Failed to remove the variable.'
end
...
...
app/presenters/ci/variable_presenter.rb
View file @
b7d17aab
...
...
@@ -8,9 +8,9 @@ module Ci
def
form_path
if
variable
.
persisted?
namespace_project_variable_path
(
project
.
namespace
,
project
,
variable
)
project_variable_path
(
project
,
variable
)
else
namespace_project_variables_path
(
project
.
namespace
,
project
)
project_variables_path
(
project
)
end
end
...
...
spec/presenters/ci/variable_presenter_spec.rb
View file @
b7d17aab
...
...
@@ -38,26 +38,26 @@ describe Ci::VariablePresenter do
context
'when variable is persisted'
do
subject
{
described_class
.
new
(
variable
).
form_path
}
it
{
is_expected
.
to
eq
(
namespace_project_variable_path
(
project
.
namespace
,
project
,
variable
))
}
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
(
namespace_project_variables_path
(
project
.
namespace
,
project
))
}
it
{
is_expected
.
to
eq
(
project_variables_path
(
project
))
}
end
end
describe
'#edit_path'
do
subject
{
described_class
.
new
(
variable
).
edit_path
}
it
{
is_expected
.
to
eq
(
namespace_project_variable_path
(
project
.
namespace
,
project
,
variable
))
}
it
{
is_expected
.
to
eq
(
project_variable_path
(
project
,
variable
))
}
end
describe
'#delete_path'
do
subject
{
described_class
.
new
(
variable
).
delete_path
}
it
{
is_expected
.
to
eq
(
namespace_project_variable_path
(
project
.
namespace
,
project
,
variable
))
}
it
{
is_expected
.
to
eq
(
project_variable_path
(
project
,
variable
))
}
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