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
3afd7fb2
Commit
3afd7fb2
authored
Mar 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for new pipeline and build action events
parent
a263e370
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+24
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+8
-0
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+0
-1
No files found.
spec/models/ci/build_spec.rb
View file @
3afd7fb2
...
...
@@ -20,6 +20,30 @@ describe Ci::Build, :models do
it
{
is_expected
.
to
validate_presence_of
:ref
}
it
{
is_expected
.
to
respond_to
:trace_html
}
describe
'#actionize'
do
context
'when build is a created'
do
before
do
build
.
update_column
(
:status
,
:created
)
end
it
'makes build a manual action'
do
expect
(
build
.
actionize
).
to
be
true
expect
(
build
.
reload
).
to
be_manual
end
end
context
'when build is not created'
do
before
do
build
.
update_column
(
:status
,
:pending
)
end
it
'does not change build status'
do
expect
(
build
.
actionize
).
to
be
false
expect
(
build
.
reload
).
to
be_pending
end
end
end
describe
'#any_runners_online?'
do
subject
{
build
.
any_runners_online?
}
...
...
spec/models/ci/pipeline_spec.rb
View file @
3afd7fb2
...
...
@@ -24,6 +24,14 @@ describe Ci::Pipeline, models: true do
it
{
is_expected
.
to
respond_to
:git_author_email
}
it
{
is_expected
.
to
respond_to
:short_sha
}
describe
'#block'
do
it
'changes pipeline status to manual'
do
expect
(
pipeline
.
block
).
to
be
true
expect
(
pipeline
.
reload
).
to
be_manual
expect
(
pipeline
.
reload
).
to
be_blocked
end
end
describe
'#valid_commit_sha'
do
context
'commit.sha can not start with 00000000'
do
before
do
...
...
spec/services/ci/process_pipeline_service_spec.rb
View file @
3afd7fb2
...
...
@@ -342,7 +342,6 @@ describe Ci::ProcessPipelineService, '#execute', :services do
expect
(
builds_statuses
).
to
eq
%w[success success success manual]
expect
(
pipeline
.
reload
).
to
be_manual
# TODO, expect(pipeline.reload).to be_started
expect
(
pipeline
.
reload
).
to
be_blocked
expect
(
pipeline
.
reload
).
not_to
be_active
expect
(
pipeline
.
reload
).
not_to
be_complete
...
...
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