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
c7c24940
Commit
c7c24940
authored
Dec 02, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add implementation of common pipeline extended status
parent
0c7168b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
lib/gitlab/ci/status/core/base.rb
lib/gitlab/ci/status/core/base.rb
+2
-0
lib/gitlab/ci/status/extended/pipeline/common.rb
lib/gitlab/ci/status/extended/pipeline/common.rb
+3
-4
spec/lib/gitlab/ci/status/extended/pipeline/common_spec.rb
spec/lib/gitlab/ci/status/extended/pipeline/common_spec.rb
+23
-0
No files found.
lib/gitlab/ci/status/core/base.rb
View file @
c7c24940
...
@@ -4,6 +4,8 @@ module Gitlab::Ci
...
@@ -4,6 +4,8 @@ module Gitlab::Ci
# Base abstract class fore core status
# Base abstract class fore core status
#
#
class
Base
class
Base
include
Gitlab
::
Routing
.
url_helpers
def
initialize
(
subject
)
def
initialize
(
subject
)
@subject
=
subject
@subject
=
subject
end
end
...
...
lib/gitlab/ci/status/extended/pipeline/common.rb
View file @
c7c24940
...
@@ -3,15 +3,14 @@ module Gitlab::Ci
...
@@ -3,15 +3,14 @@ module Gitlab::Ci
module
Extended
module
Extended
module
Pipeline
module
Pipeline
module
Common
module
Common
def
initialize
(
pipeline
)
@pipeline
=
pipeline
end
def
has_details?
def
has_details?
true
true
end
end
def
details_path
def
details_path
namespace_project_pipeline_path
(
@subject
.
project
.
namespace
,
@subject
.
project
,
@subject
)
end
end
def
has_action?
def
has_action?
...
...
spec/lib/gitlab/ci/status/extended/pipeline/common_spec.rb
View file @
c7c24940
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Extended
::
Pipeline
::
Common
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
subject
do
Gitlab
::
Ci
::
Status
::
Core
::
Success
.
new
(
pipeline
).
extend
(
described_class
)
end
it
'does not have action'
do
expect
(
subject
).
not_to
have_action
end
it
'has details'
do
expect
(
subject
).
to
have_details
end
it
'links to the pipeline details page'
do
expect
(
subject
.
details_path
)
.
to
include
"pipelines/
#{
pipeline
.
id
}
"
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