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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f3ec51be
Commit
f3ec51be
authored
Sep 28, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a additional scope related to alive CI/CD statuses
parent
d3762c22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-0
spec/models/concerns/has_status_spec.rb
spec/models/concerns/has_status_spec.rb
+12
-0
No files found.
app/models/concerns/has_status.rb
View file @
f3ec51be
...
@@ -81,6 +81,7 @@ module HasStatus
...
@@ -81,6 +81,7 @@ module HasStatus
scope
:canceled
,
->
{
where
(
status:
'canceled'
)
}
scope
:canceled
,
->
{
where
(
status:
'canceled'
)
}
scope
:skipped
,
->
{
where
(
status:
'skipped'
)
}
scope
:skipped
,
->
{
where
(
status:
'skipped'
)
}
scope
:manual
,
->
{
where
(
status:
'manual'
)
}
scope
:manual
,
->
{
where
(
status:
'manual'
)
}
scope
:alive
,
->
{
where
(
status:
[
:created
,
:pending
,
:running
])
}
scope
:created_or_pending
,
->
{
where
(
status:
[
:created
,
:pending
])
}
scope
:created_or_pending
,
->
{
where
(
status:
[
:created
,
:pending
])
}
scope
:running_or_pending
,
->
{
where
(
status:
[
:running
,
:pending
])
}
scope
:running_or_pending
,
->
{
where
(
status:
[
:running
,
:pending
])
}
scope
:finished
,
->
{
where
(
status:
[
:success
,
:failed
,
:canceled
])
}
scope
:finished
,
->
{
where
(
status:
[
:success
,
:failed
,
:canceled
])
}
...
...
spec/models/concerns/has_status_spec.rb
View file @
f3ec51be
...
@@ -231,6 +231,18 @@ describe HasStatus do
...
@@ -231,6 +231,18 @@ describe HasStatus do
end
end
end
end
describe
'.alive'
do
subject
{
CommitStatus
.
alive
}
%i[running pending created]
.
each
do
|
status
|
it_behaves_like
'containing the job'
,
status
end
%i[failed success]
.
each
do
|
status
|
it_behaves_like
'not containing the job'
,
status
end
end
describe
'.created_or_pending'
do
describe
'.created_or_pending'
do
subject
{
CommitStatus
.
created_or_pending
}
subject
{
CommitStatus
.
created_or_pending
}
...
...
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