Commit 73fcfb29 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add a default status const to common status concern

parent 3bc0525a
module HasStatus
extend ActiveSupport::Concern
DEFAULT_STATUS = 'created'
AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped]
STARTED_STATUSES = %w[running success failed skipped]
ACTIVE_STATUSES = %w[pending running]
......
......@@ -5,7 +5,7 @@ module Gitlab
def initialize(subject, user)
@subject = subject
@user = user
@status = subject.status || :created
@status = subject.status || HasStatus::DEFAULT_STATUS
end
def fabricate!
......
......@@ -219,4 +219,10 @@ describe HasStatus do
end
end
end
describe '::DEFAULT_STATUS' do
it 'is a status created' do
expect(described_class::DEFAULT_STATUS).to eq 'created'
end
end
end
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