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
6c7f7f69
Commit
6c7f7f69
authored
Feb 14, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for after_stage scope, update specs file
parent
cff9504a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+18
-4
No files found.
spec/models/commit_status_spec.rb
View file @
6c7f7f69
require
'spec_helper'
describe
CommitStatus
,
models:
true
do
describe
CommitStatus
,
:models
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
...
...
@@ -127,7 +127,7 @@ describe CommitStatus, models: true do
end
describe
'.latest'
do
subject
{
CommitStatu
s
.
latest
.
order
(
:id
)
}
subject
{
described_clas
s
.
latest
.
order
(
:id
)
}
let
(
:statuses
)
do
[
create_status
(
name:
'aa'
,
ref:
'bb'
,
status:
'running'
),
...
...
@@ -143,7 +143,7 @@ describe CommitStatus, models: true do
end
describe
'.running_or_pending'
do
subject
{
CommitStatu
s
.
running_or_pending
.
order
(
:id
)
}
subject
{
described_clas
s
.
running_or_pending
.
order
(
:id
)
}
let
(
:statuses
)
do
[
create_status
(
name:
'aa'
,
ref:
'bb'
,
status:
'running'
),
...
...
@@ -159,7 +159,21 @@ describe CommitStatus, models: true do
end
describe
'.exclude_ignored'
do
subject
{
CommitStatus
.
exclude_ignored
.
order
(
:id
)
}
subject
{
described_class
.
after_stage
(
0
)
}
let
(
:statuses
)
do
[
create_status
(
name:
'aa'
,
stage_idx:
0
),
create_status
(
name:
'cc'
,
stage_idx:
1
),
create_status
(
name:
'aa'
,
stage_idx:
2
)]
end
it
'returns statuses from second and third stage'
do
is_expected
.
to
eq
(
statuses
.
values_at
(
1
,
2
))
end
end
describe
'.exclude_ignored'
do
subject
{
described_class
.
exclude_ignored
.
order
(
:id
)
}
let
(
:statuses
)
do
[
create_status
(
when:
'manual'
,
status:
'skipped'
),
...
...
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