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

Add a default status const to common status concern

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