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
3447d71e
Commit
3447d71e
authored
Mar 29, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for empty states .matches? methods
parent
ddabac46
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
1 deletion
+110
-1
spec/lib/gitlab/ci/status/build/canceled_spec.rb
spec/lib/gitlab/ci/status/build/canceled_spec.rb
+22
-0
spec/lib/gitlab/ci/status/build/created_spec.rb
spec/lib/gitlab/ci/status/build/created_spec.rb
+22
-0
spec/lib/gitlab/ci/status/build/manual_spec.rb
spec/lib/gitlab/ci/status/build/manual_spec.rb
+22
-1
spec/lib/gitlab/ci/status/build/pending_spec.rb
spec/lib/gitlab/ci/status/build/pending_spec.rb
+22
-0
spec/lib/gitlab/ci/status/build/skipped_spec.rb
spec/lib/gitlab/ci/status/build/skipped_spec.rb
+22
-0
No files found.
spec/lib/gitlab/ci/status/build/canceled_spec.rb
View file @
3447d71e
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Canceled
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Canceled
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
described_class
.
new
(
double
(
'subject'
))
described_class
.
new
(
double
(
'subject'
))
end
end
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Canceled do
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Canceled do
describe
'#illustration'
do
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
}
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
}
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build is canceled'
do
let
(
:build
)
{
create
(
:ci_build
,
:canceled
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build is not canceled'
do
let
(
:build
)
{
create
(
:ci_build
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
end
end
end
end
spec/lib/gitlab/ci/status/build/created_spec.rb
View file @
3447d71e
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Created
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Created
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
described_class
.
new
(
double
(
'subject'
))
described_class
.
new
(
double
(
'subject'
))
end
end
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Created do
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Created do
describe
'#illustration'
do
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build is created'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build is not created'
do
let
(
:build
)
{
create
(
:ci_build
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
end
end
end
end
spec/lib/gitlab/ci/status/build/manual_spec.rb
View file @
3447d71e
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Manual
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Manual
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
user
=
create
(
:user
)
build
=
create
(
:ci_build
,
:manual
)
build
=
create
(
:ci_build
,
:manual
)
described_class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
.
new
(
build
,
user
))
described_class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
.
new
(
build
,
user
))
end
end
...
@@ -10,4 +11,24 @@ describe Gitlab::Ci::Status::Build::Manual do
...
@@ -10,4 +11,24 @@ describe Gitlab::Ci::Status::Build::Manual do
describe
'#illustration'
do
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build is manual'
do
let
(
:build
)
{
create
(
:ci_build
,
:manual
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build is not manual'
do
let
(
:build
)
{
create
(
:ci_build
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
end
end
end
end
spec/lib/gitlab/ci/status/build/pending_spec.rb
View file @
3447d71e
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Pending
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Pending
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
described_class
.
new
(
double
(
'subject'
))
described_class
.
new
(
double
(
'subject'
))
end
end
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Pending do
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Pending do
describe
'#illustration'
do
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build is pending'
do
let
(
:build
)
{
create
(
:ci_build
,
:pending
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build is not pending'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
end
end
end
end
spec/lib/gitlab/ci/status/build/skipped_spec.rb
View file @
3447d71e
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Skipped
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Skipped
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
described_class
.
new
(
double
(
'subject'
))
described_class
.
new
(
double
(
'subject'
))
end
end
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Skipped do
...
@@ -8,4 +10,24 @@ describe Gitlab::Ci::Status::Build::Skipped do
describe
'#illustration'
do
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
}
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
}
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build is skipped'
do
let
(
:build
)
{
create
(
:ci_build
,
:skipped
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build is not skipped'
do
let
(
:build
)
{
create
(
:ci_build
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
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