BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8c434a52
Commit
8c434a52
authored
Jul 06, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gb nice catches
parent
61d5b138
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
variables_controller.rb
app/controllers/groups/variables_controller.rb
+5
-5
variables_controller.rb
app/controllers/projects/variables_controller.rb
+5
-5
variables_controller_spec.rb
spec/controllers/groups/variables_controller_spec.rb
+1
-1
variables_controller_spec.rb
spec/controllers/projects/variables_controller_spec.rb
+1
-1
No files found.
app/controllers/groups/variables_controller.rb
View file @
8c434a52
...
...
@@ -20,13 +20,13 @@ module Groups
end
def
create
new_variable
=
group
.
variables
.
create
(
group_params
)
@variable
=
group
.
variables
.
create
(
group_params
)
.
present
(
current_user:
current_user
)
if
new_
variable
.
persisted?
if
@
variable
.
persisted?
redirect_to
group_settings_ci_cd_path
(
group
),
notice:
'Variable
s were successfully upd
ated.'
notice:
'Variable
was successfully cre
ated.'
else
@variable
=
new_variable
.
present
(
current_user:
current_user
)
render
"show"
end
end
...
...
@@ -39,7 +39,7 @@ module Groups
else
redirect_to
group_settings_ci_cd_path
(
group
),
status:
302
,
notice:
'Failed to remove the variable'
notice:
'Failed to remove the variable
.
'
end
end
...
...
app/controllers/projects/variables_controller.rb
View file @
8c434a52
...
...
@@ -21,13 +21,13 @@ class Projects::VariablesController < Projects::ApplicationController
end
def
create
new_variable
=
project
.
variables
.
create
(
project_params
)
@variable
=
project
.
variables
.
create
(
project_params
)
.
present
(
current_user:
current_user
)
if
new_
variable
.
persisted?
if
@
variable
.
persisted?
redirect_to
project_settings_ci_cd_path
(
project
),
notice:
'Variable
s were successfully upd
ated.'
notice:
'Variable
was successfully cre
ated.'
else
@variable
=
new_variable
.
present
(
current_user:
current_user
)
render
"show"
end
end
...
...
@@ -40,7 +40,7 @@ class Projects::VariablesController < Projects::ApplicationController
else
redirect_to
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
),
status:
302
,
notice:
'Failed to remove the variable'
notice:
'Failed to remove the variable
.
'
end
end
...
...
spec/controllers/groups/variables_controller_spec.rb
View file @
8c434a52
...
...
@@ -14,7 +14,7 @@ describe Groups::VariablesController do
it
'shows a success flash message'
do
post
:create
,
group_id:
group
,
variable:
{
key:
"one"
,
value:
"two"
}
expect
(
flash
[
:notice
]).
to
include
'Variable
s were successfully upd
ated.'
expect
(
flash
[
:notice
]).
to
include
'Variable
was successfully cre
ated.'
expect
(
response
).
to
redirect_to
(
group_settings_ci_cd_path
(
group
))
end
end
...
...
spec/controllers/projects/variables_controller_spec.rb
View file @
8c434a52
...
...
@@ -15,7 +15,7 @@ describe Projects::VariablesController do
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
variable:
{
key:
"one"
,
value:
"two"
}
expect
(
flash
[
:notice
]).
to
include
'Variable
s were successfully upd
ated.'
expect
(
flash
[
:notice
]).
to
include
'Variable
was successfully cre
ated.'
expect
(
response
).
to
redirect_to
(
project_settings_ci_cd_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