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
Boxiang Sun
gitlab-ce
Commits
23feb6a7
Commit
23feb6a7
authored
Dec 08, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests related to detailed statuses and permissions
[ci skip]
parent
5059d0b8
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
45 additions
and
41 deletions
+45
-41
spec/lib/gitlab/ci/status/canceled_spec.rb
spec/lib/gitlab/ci/status/canceled_spec.rb
+3
-1
spec/lib/gitlab/ci/status/created_spec.rb
spec/lib/gitlab/ci/status/created_spec.rb
+3
-5
spec/lib/gitlab/ci/status/extended_spec.rb
spec/lib/gitlab/ci/status/extended_spec.rb
+1
-1
spec/lib/gitlab/ci/status/factory_spec.rb
spec/lib/gitlab/ci/status/factory_spec.rb
+4
-2
spec/lib/gitlab/ci/status/failed_spec.rb
spec/lib/gitlab/ci/status/failed_spec.rb
+3
-5
spec/lib/gitlab/ci/status/pending_spec.rb
spec/lib/gitlab/ci/status/pending_spec.rb
+3
-5
spec/lib/gitlab/ci/status/pipeline/common_spec.rb
spec/lib/gitlab/ci/status/pipeline/common_spec.rb
+3
-1
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
+3
-1
spec/lib/gitlab/ci/status/pipeline/success_with_warnings_spec.rb
...b/gitlab/ci/status/pipeline/success_with_warnings_spec.rb
+1
-1
spec/lib/gitlab/ci/status/running_spec.rb
spec/lib/gitlab/ci/status/running_spec.rb
+3
-5
spec/lib/gitlab/ci/status/skipped_spec.rb
spec/lib/gitlab/ci/status/skipped_spec.rb
+3
-5
spec/lib/gitlab/ci/status/stage/common_spec.rb
spec/lib/gitlab/ci/status/stage/common_spec.rb
+6
-2
spec/lib/gitlab/ci/status/stage/factory_spec.rb
spec/lib/gitlab/ci/status/stage/factory_spec.rb
+6
-2
spec/lib/gitlab/ci/status/success_spec.rb
spec/lib/gitlab/ci/status/success_spec.rb
+3
-5
No files found.
spec/lib/gitlab/ci/status/canceled_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Canceled
do
describe
Gitlab
::
Ci
::
Status
::
Canceled
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'canceled'
}
it
{
expect
(
subject
.
label
).
to
eq
'canceled'
}
...
...
spec/lib/gitlab/ci/status/created_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Created
do
describe
Gitlab
::
Ci
::
Status
::
Created
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'created'
}
it
{
expect
(
subject
.
label
).
to
eq
'created'
}
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Created do
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Created do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_created'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_created'
}
end
end
describe
'#title'
do
it
{
expect
(
subject
.
title
).
to
eq
'Double: created'
}
end
end
end
spec/lib/gitlab/ci/status/extended_spec.rb
View file @
23feb6a7
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Extended do
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Extended do
end
end
it
'requires subclass to implement matcher'
do
it
'requires subclass to implement matcher'
do
expect
{
subject
.
matches?
(
double
)
}
expect
{
subject
.
matches?
(
double
,
double
)
}
.
to
raise_error
(
NotImplementedError
)
.
to
raise_error
(
NotImplementedError
)
end
end
end
end
spec/lib/gitlab/ci/status/factory_spec.rb
View file @
23feb6a7
...
@@ -2,15 +2,17 @@ require 'spec_helper'
...
@@ -2,15 +2,17 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Factory
do
describe
Gitlab
::
Ci
::
Status
::
Factory
do
subject
do
subject
do
described_class
.
new
(
object
)
described_class
.
new
(
resource
,
user
)
end
end
let
(
:user
)
{
create
(
:user
)
}
let
(
:status
)
{
subject
.
fabricate!
}
let
(
:status
)
{
subject
.
fabricate!
}
context
'when object has a core status'
do
context
'when object has a core status'
do
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
core_status
|
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
core_status
|
context
"when core status is
#{
core_status
}
"
do
context
"when core status is
#{
core_status
}
"
do
let
(
:
object
)
{
double
(
status:
core_status
)
}
let
(
:
resource
)
{
double
(
status:
core_status
)
}
it
"fabricates a core status
#{
core_status
}
"
do
it
"fabricates a core status
#{
core_status
}
"
do
expect
(
status
).
to
be_a
(
expect
(
status
).
to
be_a
(
...
...
spec/lib/gitlab/ci/status/failed_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Failed
do
describe
Gitlab
::
Ci
::
Status
::
Failed
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'failed'
}
it
{
expect
(
subject
.
label
).
to
eq
'failed'
}
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Failed do
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Failed do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_failed'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_failed'
}
end
end
describe
'#title'
do
it
{
expect
(
subject
.
title
).
to
eq
'Double: failed'
}
end
end
end
spec/lib/gitlab/ci/status/pending_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pending
do
describe
Gitlab
::
Ci
::
Status
::
Pending
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'pending'
}
it
{
expect
(
subject
.
label
).
to
eq
'pending'
}
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Pending do
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Pending do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_pending'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_pending'
}
end
end
describe
'#title'
do
it
{
expect
(
subject
.
title
).
to
eq
'Double: pending'
}
end
end
end
spec/lib/gitlab/ci/status/pipeline/common_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Common
do
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Common
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
subject
do
subject
do
Class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
)
Class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
)
.
new
(
pipeline
).
extend
(
described_class
)
.
new
(
pipeline
,
user
)
.
extend
(
described_class
)
end
end
it
'does not have action'
do
it
'does not have action'
do
...
...
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Factory
do
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Factory
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
described_class
.
new
(
pipeline
)
described_class
.
new
(
pipeline
,
user
)
end
end
let
(
:status
)
do
let
(
:status
)
do
...
...
spec/lib/gitlab/ci/status/pipeline/success_with_warnings_spec.rb
View file @
23feb6a7
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
SuccessWithWarnings
do
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
SuccessWithWarnings
do
subject
do
subject
do
described_class
.
new
(
double
(
'status'
))
described_class
.
new
(
double
(
'status'
)
,
double
(
'user'
)
)
end
end
describe
'#test'
do
describe
'#test'
do
...
...
spec/lib/gitlab/ci/status/running_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Running
do
describe
Gitlab
::
Ci
::
Status
::
Running
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'running'
}
it
{
expect
(
subject
.
label
).
to
eq
'running'
}
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Running do
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Running do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_running'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_running'
}
end
end
describe
'#title'
do
it
{
expect
(
subject
.
title
).
to
eq
'Double: running'
}
end
end
end
spec/lib/gitlab/ci/status/skipped_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Skipped
do
describe
Gitlab
::
Ci
::
Status
::
Skipped
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'skipped'
}
it
{
expect
(
subject
.
label
).
to
eq
'skipped'
}
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Skipped do
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Skipped do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_skipped'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_skipped'
}
end
end
describe
'#title'
do
it
{
expect
(
subject
.
title
).
to
eq
'Double: skipped'
}
end
end
end
spec/lib/gitlab/ci/status/stage/common_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Stage
::
Common
do
describe
Gitlab
::
Ci
::
Status
::
Stage
::
Common
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:stage
)
{
build
(
:ci_stage
,
pipeline:
pipeline
,
name:
'test'
)
}
let
(
:stage
)
do
build
(
:ci_stage
,
pipeline:
pipeline
,
name:
'test'
)
end
subject
do
subject
do
Class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
)
Class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
)
.
new
(
stage
).
extend
(
described_class
)
.
new
(
stage
,
user
).
extend
(
described_class
)
end
end
it
'does not have action'
do
it
'does not have action'
do
...
...
spec/lib/gitlab/ci/status/stage/factory_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Stage
::
Factory
do
describe
Gitlab
::
Ci
::
Status
::
Stage
::
Factory
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:stage
)
{
build
(
:ci_stage
,
pipeline:
pipeline
,
name:
'test'
)
}
let
(
:stage
)
do
build
(
:ci_stage
,
pipeline:
pipeline
,
name:
'test'
)
end
subject
do
subject
do
described_class
.
new
(
stage
)
described_class
.
new
(
stage
,
user
)
end
end
let
(
:status
)
do
let
(
:status
)
do
...
...
spec/lib/gitlab/ci/status/success_spec.rb
View file @
23feb6a7
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Success
do
describe
Gitlab
::
Ci
::
Status
::
Success
do
subject
{
described_class
.
new
(
double
(
'subject'
))
}
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'passed'
}
it
{
expect
(
subject
.
label
).
to
eq
'passed'
}
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Success do
...
@@ -14,8 +16,4 @@ describe Gitlab::Ci::Status::Success do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_success'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_success'
}
end
end
describe
'#title'
do
it
{
expect
(
subject
.
title
).
to
eq
'Double: passed'
}
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