Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
73fcfb29
Commit
73fcfb29
authored
Jan 18, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a default status const to common status concern
parent
3bc0525a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-0
lib/gitlab/ci/status/factory.rb
lib/gitlab/ci/status/factory.rb
+1
-1
spec/models/concerns/has_status_spec.rb
spec/models/concerns/has_status_spec.rb
+6
-0
No files found.
app/models/concerns/has_status.rb
View file @
73fcfb29
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]
...
...
lib/gitlab/ci/status/factory.rb
View file @
73fcfb29
...
@@ -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!
...
...
spec/models/concerns/has_status_spec.rb
View file @
73fcfb29
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment