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
5dfa2914
Commit
5dfa2914
authored
Sep 18, 2016
by
Ruben Davila
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 8-12-stable
parents
bb26c97a
1d51bc7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+1
-1
spec/views/projects/pipelines/show.html.haml_spec.rb
spec/views/projects/pipelines/show.html.haml_spec.rb
+10
-7
No files found.
app/models/concerns/has_status.rb
View file @
5dfa2914
...
...
@@ -20,7 +20,7 @@ module HasStatus
skipped
=
scope
.
skipped
.
select
(
'count(*)'
).
to_sql
deduce_status
=
"(CASE
WHEN (
#{
builds
}
)=(
#{
created
}
) THEN
NULL
WHEN (
#{
builds
}
)=(
#{
created
}
) THEN
'created'
WHEN (
#{
builds
}
)=(
#{
skipped
}
) THEN 'skipped'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'success'
WHEN (
#{
builds
}
)=(
#{
created
}
)+(
#{
pending
}
)+(
#{
skipped
}
) THEN 'pending'
...
...
spec/requests/api/commits_spec.rb
View file @
5dfa2914
...
...
@@ -110,7 +110,7 @@ describe API::API, api: true do
get
api
(
"/projects/
#{
project
.
id
}
/repository/commits/
#{
project
.
repository
.
commit
.
id
}
"
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
[
'status'
]).
to
be_nil
expect
(
json_response
[
'status'
]).
to
eq
(
"created"
)
end
end
...
...
spec/views/projects/pipelines/show.html.haml_spec.rb
View file @
5dfa2914
...
...
@@ -9,11 +9,13 @@ describe 'projects/pipelines/show' do
before
do
controller
.
prepend_view_path
(
'app/views/projects'
)
create_build
(
'build'
,
0
,
'build'
)
create_build
(
'test'
,
1
,
'rspec 0:2'
)
create_build
(
'test'
,
1
,
'rspec 1:2'
)
create_build
(
'test'
,
1
,
'audit'
)
create_build
(
'deploy'
,
2
,
'production'
)
create_build
(
'build'
,
0
,
'build'
,
:success
)
create_build
(
'test'
,
1
,
'rspec 0:2'
,
:pending
)
create_build
(
'test'
,
1
,
'rspec 1:2'
,
:running
)
create_build
(
'test'
,
1
,
'spinach 0:2'
,
:created
)
create_build
(
'test'
,
1
,
'spinach 1:2'
,
:created
)
create_build
(
'test'
,
1
,
'audit'
,
:created
)
create_build
(
'deploy'
,
2
,
'production'
,
:created
)
create
(
:generic_commit_status
,
pipeline:
pipeline
,
stage:
'external'
,
name:
'jenkins'
,
stage_idx:
3
)
...
...
@@ -37,6 +39,7 @@ describe 'projects/pipelines/show' do
# builds
expect
(
rendered
).
to
have_text
(
'rspec'
)
expect
(
rendered
).
to
have_text
(
'spinach'
)
expect
(
rendered
).
to
have_text
(
'rspec 0:2'
)
expect
(
rendered
).
to
have_text
(
'production'
)
expect
(
rendered
).
to
have_text
(
'jenkins'
)
...
...
@@ -44,7 +47,7 @@ describe 'projects/pipelines/show' do
private
def
create_build
(
stage
,
stage_idx
,
name
)
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
,
stage_idx:
stage_idx
,
name:
name
)
def
create_build
(
stage
,
stage_idx
,
name
,
status
)
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
,
stage_idx:
stage_idx
,
name:
name
,
status:
status
)
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