Commit 23bed91b authored by De Wet Blomerus's avatar De Wet Blomerus

rename Statuseable to HasStatus

parent 6fb46b60
module Ci module Ci
class Pipeline < ActiveRecord::Base class Pipeline < ActiveRecord::Base
extend Ci::Model extend Ci::Model
include Statuseable include HasStatus
self.table_name = 'ci_commits' self.table_name = 'ci_commits'
......
class CommitStatus < ActiveRecord::Base class CommitStatus < ActiveRecord::Base
include Statuseable include HasStatus
include Importable include Importable
self.table_name = 'ci_builds' self.table_name = 'ci_builds'
......
module Statuseable module HasStatus
extend ActiveSupport::Concern extend ActiveSupport::Concern
AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped] AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped]
......
...@@ -34,7 +34,7 @@ module Ci ...@@ -34,7 +34,7 @@ module Ci
end end
def process_build(build, current_status) def process_build(build, current_status)
return false unless Statuseable::COMPLETED_STATUSES.include?(current_status) return false unless HasStatus::COMPLETED_STATUSES.include?(current_status)
if valid_statuses_for_when(build.when).include?(current_status) if valid_statuses_for_when(build.when).include?(current_status)
build.enqueue build.enqueue
......
require 'spec_helper' require 'spec_helper'
describe Statuseable do describe HasStatus do
before do before do
@object = Object.new @object = Object.new
@object.extend(Statuseable::ClassMethods) @object.extend(HasStatus::ClassMethods)
end end
describe '.status' do describe '.status' do
...@@ -12,7 +12,7 @@ describe Statuseable do ...@@ -12,7 +12,7 @@ describe Statuseable do
end end
subject { @object.status } subject { @object.status }
shared_examples 'build status summary' do shared_examples 'build status summary' do
context 'all successful' do context 'all successful' do
let(:statuses) { Array.new(2) { create(type, status: :success) } } let(:statuses) { Array.new(2) { create(type, status: :success) } }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment