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
Boxiang Sun
gitlab-ce
Commits
97a11136
Commit
97a11136
authored
Oct 05, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix create_trigger_request_service_spec
parent
517815f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
app/services/ci/create_trigger_request_service.rb
app/services/ci/create_trigger_request_service.rb
+2
-1
spec/requests/ci/api/triggers_spec.rb
spec/requests/ci/api/triggers_spec.rb
+2
-2
spec/services/ci/create_trigger_request_service_spec.rb
spec/services/ci/create_trigger_request_service_spec.rb
+4
-4
No files found.
app/services/ci/create_trigger_request_service.rb
View file @
97a11136
...
@@ -10,7 +10,8 @@ module Ci
...
@@ -10,7 +10,8 @@ module Ci
ci_commit
=
project
.
gl_project
.
ensure_ci_commit
(
commit
.
sha
)
ci_commit
=
project
.
gl_project
.
ensure_ci_commit
(
commit
.
sha
)
trigger_request
=
trigger
.
trigger_requests
.
create!
(
trigger_request
=
trigger
.
trigger_requests
.
create!
(
variables:
variables
variables:
variables
,
commit:
ci_commit
,
)
)
if
ci_commit
.
create_builds
(
ref
,
tag
,
nil
,
trigger_request
)
if
ci_commit
.
create_builds
(
ref
,
tag
,
nil
,
trigger_request
)
...
...
spec/requests/ci/api/triggers_spec.rb
View file @
97a11136
...
@@ -5,8 +5,8 @@ describe Ci::API::API do
...
@@ -5,8 +5,8 @@ describe Ci::API::API do
describe
'POST /projects/:project_id/refs/:ref/trigger'
do
describe
'POST /projects/:project_id/refs/:ref/trigger'
do
let!
(
:trigger_token
)
{
'secure token'
}
let!
(
:trigger_token
)
{
'secure token'
}
let!
(
:
project
)
{
FactoryGirl
.
create
(
:ci_
project
)
}
let!
(
:
gl_project
)
{
FactoryGirl
.
create
(
:
project
)
}
let!
(
:
gl_project
)
{
FactoryGirl
.
create
(
:project
,
gitlab_ci_project:
project
)
}
let!
(
:
project
)
{
FactoryGirl
.
create
(
:ci_project
,
gl_project:
gl_
project
)
}
let!
(
:project2
)
{
FactoryGirl
.
create
(
:ci_project
)
}
let!
(
:project2
)
{
FactoryGirl
.
create
(
:ci_project
)
}
let!
(
:trigger
)
{
FactoryGirl
.
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token
)
}
let!
(
:trigger
)
{
FactoryGirl
.
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token
)
}
let
(
:options
)
do
let
(
:options
)
do
...
...
spec/services/ci/create_trigger_request_service_spec.rb
View file @
97a11136
...
@@ -2,9 +2,9 @@ require 'spec_helper'
...
@@ -2,9 +2,9 @@ require 'spec_helper'
describe
Ci
::
CreateTriggerRequestService
do
describe
Ci
::
CreateTriggerRequestService
do
let
(
:service
)
{
Ci
::
CreateTriggerRequestService
.
new
}
let
(
:service
)
{
Ci
::
CreateTriggerRequestService
.
new
}
let
(
:
project
)
{
FactoryGirl
.
create
:ci_project
}
let
(
:
gl_project
)
{
create
(
:project
)
}
let
(
:
gl_project
)
{
FactoryGirl
.
create
:project
,
gitlab_ci_project:
project
}
let
(
:
project
)
{
create
(
:ci_project
,
gl_project:
gl_project
)
}
let
(
:trigger
)
{
FactoryGirl
.
create
:ci_trigger
,
project:
project
}
let
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
)
}
before
do
before
do
stub_ci_commit_to_return_yaml_file
stub_ci_commit_to_return_yaml_file
...
@@ -15,7 +15,7 @@ describe Ci::CreateTriggerRequestService do
...
@@ -15,7 +15,7 @@ describe Ci::CreateTriggerRequestService do
subject
{
service
.
execute
(
project
,
trigger
,
'master'
)
}
subject
{
service
.
execute
(
project
,
trigger
,
'master'
)
}
it
{
expect
(
subject
).
to
be_kind_of
(
Ci
::
TriggerRequest
)
}
it
{
expect
(
subject
).
to
be_kind_of
(
Ci
::
TriggerRequest
)
}
it
{
expect
(
subject
.
commit
).
to
be_kind_of
(
Ci
::
Commit
)
}
it
{
expect
(
subject
.
builds
.
first
).
to
be_kind_of
(
Ci
::
Build
)
}
end
end
context
'no commit for ref'
do
context
'no commit for ref'
do
...
...
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