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
28ce41c0
Commit
28ce41c0
authored
Apr 18, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
433ca739
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
27 deletions
+28
-27
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
features/steps/dashboard/dashboard.rb
features/steps/dashboard/dashboard.rb
+1
-1
spec/models/ci/commit_spec.rb
spec/models/ci/commit_spec.rb
+26
-1
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+0
-24
No files found.
app/models/commit_status.rb
View file @
28ce41c0
...
...
@@ -110,7 +110,7 @@ class CommitStatus < ActiveRecord::Base
elsif
started_at
Time
.
now
-
started_at
end
duration
.
to_i
duration
end
def
stuck?
...
...
features/steps/dashboard/dashboard.rb
View file @
28ce41c0
...
...
@@ -13,7 +13,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step
'I should see "Shop" project CI status'
do
expect
(
page
).
to
have_link
"Build
:
skipped"
expect
(
page
).
to
have_link
"Build skipped"
end
step
'I should see last push widget'
do
...
...
spec/models/ci/commit_spec.rb
View file @
28ce41c0
...
...
@@ -355,7 +355,8 @@ describe Ci::Commit, models: true do
end
context
'update state'
do
let
(
:build
)
{
FactoryGirl
.
create
:ci_build
,
:success
,
commit:
commit
,
started_at:
Time
.
now
-
120
,
finished_at:
Time
.
now
-
60
}
let
(
:current
)
{
Time
.
now
.
change
(
:usec
=>
0
)
}
let
(
:build
)
{
FactoryGirl
.
create
:ci_build
,
:success
,
commit:
commit
,
started_at:
current
-
120
,
finished_at:
current
-
60
}
before
do
build
...
...
@@ -368,4 +369,28 @@ describe Ci::Commit, models: true do
end
end
end
describe
'#branch?'
do
subject
{
commit
.
branch?
}
context
'is not a tag'
do
before
do
commit
.
tag
=
false
end
it
'return true when tag is set to false'
do
is_expected
.
to
be_truthy
end
end
context
'is not a tag'
do
before
do
commit
.
tag
=
true
end
it
'return false when tag is set to true'
do
is_expected
.
to
be_falsey
end
end
end
end
spec/models/commit_status_spec.rb
View file @
28ce41c0
...
...
@@ -232,28 +232,4 @@ describe CommitStatus, models: true do
end
end
end
describe
'#branch?'
do
subject
{
commit_status
.
branch?
}
context
'is not a tag'
do
before
do
commit_status
.
tag
=
false
end
it
'return true when tag is set to false'
do
is_expected
.
to
be_truthy
end
end
context
'is not a tag'
do
before
do
commit_status
.
tag
=
true
end
it
'return false when tag is set to true'
do
is_expected
.
to
be_falsey
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