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
d9d417d4
Commit
d9d417d4
authored
Feb 02, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a variable_controller_spec test to test for flash messages on the #create action
parent
9739f2c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+0
-0
spec/controllers/projects/variables_controller_spec.rb
spec/controllers/projects/variables_controller_spec.rb
+31
-0
No files found.
spec/controllers/projects/settings/ci_cd_controller.rb
→
spec/controllers/projects/settings/ci_cd_controller
_spec
.rb
View file @
d9d417d4
File moved
spec/controllers/projects/variables_controller_spec.rb
0 → 100644
View file @
d9d417d4
require
'spec_helper'
describe
Projects
::
VariablesController
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
end
describe
'POST #create'
do
context
'variable is valid'
do
it
'shows a success flash message'
do
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
variable:
{
key:
"one"
,
value:
"two"
}
expect
(
flash
[
:notice
]).
to
include
'Variables were successfully updated.'
expect
(
response
).
to
redirect_to
(
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
))
end
end
context
'variable is invalid'
do
it
'shows a failure flash message'
do
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
variable:
{
key:
"..one"
,
value:
"two"
}
expect
(
flash
[
:alert
]).
to
include
'Key can contain only letters, digits and \'_\'.'
expect
(
response
).
to
redirect_to
(
namespace_project_settings_ci_cd_path
(
project
.
namespace
,
project
))
end
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