Skip to content
Snippets Groups Projects
Commit 73fcfb29 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Add a default status const to common status concern

parent 3bc0525a
No related branches found
No related tags found
No related merge requests found
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]
Loading
Loading
Loading
Loading
@@ -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!
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment