Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
cec52ca30da1
Commit
23bed91b
authored
Aug 25, 2016
by
De Wet Blomerus
Browse files
rename Statuseable to HasStatus
parent
0de40b20b390
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/models/ci/pipeline.rb
View file @
cec52ca3
module
Ci
class
Pipeline
<
ActiveRecord
::
Base
extend
Ci
::
Model
include
Status
eable
include
Has
Status
self
.
table_name
=
'ci_commits'
...
...
app/models/commit_status.rb
View file @
cec52ca3
class
CommitStatus
<
ActiveRecord
::
Base
include
Status
eable
include
Has
Status
include
Importable
self
.
table_name
=
'ci_builds'
...
...
app/models/concerns/status
eable
.rb
→
app/models/concerns/
has_
status.rb
View file @
cec52ca3
module
Status
eable
module
Has
Status
extend
ActiveSupport
::
Concern
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
...
...
app/services/ci/process_pipeline_service.rb
View file @
cec52ca3
...
...
@@ -34,7 +34,7 @@ def process_stage(index)
end
def
process_build
(
build
,
current_status
)
return
false
unless
Status
eable
::
COMPLETED_STATUSES
.
include?
(
current_status
)
return
false
unless
Has
Status
::
COMPLETED_STATUSES
.
include?
(
current_status
)
if
valid_statuses_for_when
(
build
.
when
).
include?
(
current_status
)
build
.
enqueue
...
...
spec/models/concerns/status
eable
_spec.rb
→
spec/models/concerns/
has_
status_spec.rb
View file @
cec52ca3
require
'spec_helper'
describe
Status
eable
do
describe
Has
Status
do
before
do
@object
=
Object
.
new
@object
.
extend
(
Status
eable
::
ClassMethods
)
@object
.
extend
(
Has
Status
::
ClassMethods
)
end
describe
'.status'
do
...
...
@@ -12,7 +12,7 @@
end
subject
{
@object
.
status
}
shared_examples
'build status summary'
do
context
'all successful'
do
let
(
:statuses
)
{
Array
.
new
(
2
)
{
create
(
type
,
status: :success
)
}
}
...
...
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