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
97c63eb7
Commit
97c63eb7
authored
Jul 31, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper test for api/triggers_spec.rb
parent
610a755f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
spec/requests/api/triggers_spec.rb
spec/requests/api/triggers_spec.rb
+17
-0
No files found.
spec/requests/api/triggers_spec.rb
View file @
97c63eb7
...
@@ -184,6 +184,23 @@ describe API::Triggers do
...
@@ -184,6 +184,23 @@ describe API::Triggers do
expect
(
json_response
[
'message'
]).
to
eq
(
'400 Job has to be running'
)
expect
(
json_response
[
'message'
]).
to
eq
(
'400 Job has to be running'
)
end
end
end
end
context
'when variables are defined'
do
let
(
:params
)
do
{
ref:
'refs/heads/other-branch'
,
variables:
{
'KEY'
=>
'VALUE'
}
}
end
it
'creates a new pipeline with a variable'
do
expect
{
subject
}.
to
change
(
Ci
::
Pipeline
,
:count
)
.
and
change
(
Ci
::
PipelineVariable
,
:count
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
Ci
::
Pipeline
.
last
.
source
).
to
eq
(
'pipeline'
)
expect
(
Ci
::
Pipeline
.
last
.
triggered_by_pipeline
).
not_to
be_nil
expect
(
Ci
::
Pipeline
.
last
.
variables
.
map
{
|
v
|
{
v
.
key
=>
v
.
value
}
}.
last
).
to
eq
(
params
[
:variables
])
end
end
end
end
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