rename Statuseable to HasStatus

This commit is contained in:
De Wet Blomerus 2016-08-25 04:55:32 +02:00
parent 6fb46b604e
commit 23bed91b3f
5 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
module Ci
class Pipeline < ActiveRecord::Base
extend Ci::Model
include Statuseable
include HasStatus
self.table_name = 'ci_commits'

View File

@ -1,5 +1,5 @@
class CommitStatus < ActiveRecord::Base
include Statuseable
include HasStatus
include Importable
self.table_name = 'ci_builds'

View File

@ -1,4 +1,4 @@
module Statuseable
module HasStatus
extend ActiveSupport::Concern
AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped]

View File

@ -34,7 +34,7 @@ module Ci
end
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)
build.enqueue

View File

@ -1,9 +1,9 @@
require 'spec_helper'
describe Statuseable do
describe HasStatus do
before do
@object = Object.new
@object.extend(Statuseable::ClassMethods)
@object.extend(HasStatus::ClassMethods)
end
describe '.status' do
@ -12,7 +12,7 @@ describe Statuseable do
end
subject { @object.status }
shared_examples 'build status summary' do
context 'all successful' do
let(:statuses) { Array.new(2) { create(type, status: :success) } }