Fix specs
This commit is contained in:
parent
68b7357375
commit
2677f3f613
|
@ -55,7 +55,7 @@ unless window.TravisApplication
|
|||
|
||||
type = Ember.get(Travis, 'mappings')[name]
|
||||
|
||||
if name == 'build' && data.build.commit
|
||||
if name == 'build' && data.build?.commit
|
||||
# TODO: commit should be a sideload record on build, not mixed with it
|
||||
build = data.build
|
||||
commit = {
|
||||
|
|
|
@ -86,7 +86,7 @@ require 'travis/model'
|
|||
Travis.ajax.post "/builds/#{@get('id')}/restart"
|
||||
|
||||
isPropertyLoaded: (key) ->
|
||||
if ['_duration', 'finishedAt'].contains(key) && !@get('isFinished')
|
||||
if ['_duration', '_finishedAt'].contains(key) && !@get('isFinished')
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
|
|
@ -107,9 +107,9 @@ require 'travis/model'
|
|||
).observes('state')
|
||||
|
||||
isPropertyLoaded: (key) ->
|
||||
if ['finishedAt'].contains(key) && !@get('isFinished')
|
||||
if ['_finishedAt'].contains(key) && !@get('isFinished')
|
||||
return true
|
||||
else if key == 'startedAt' && @get('state') == 'created'
|
||||
else if key == '_startedAt' && @get('state') == 'created'
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
</div>
|
||||
|
||||
<div class="runtime">
|
||||
{{#if build.isFinished}}ran{{else}}running{{/if}} for {{formatDuration build.duration}}
|
||||
{{#if build.isFinished}}ran{{else}}running{{/if}} for {{formatDuration build.duration}}
|
||||
</div>
|
||||
|
||||
<div class="finished">
|
||||
{{formatTime build.finishedAt}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="branch" {{bind-attr title="build.commit.branch"}}>
|
||||
{{build.commit.branch}}
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@ test "my repos is active by default when user is signed in", ->
|
|||
branch: 'master'
|
||||
compare: '0123456..4567890'
|
||||
finishedAt: '-'
|
||||
duration: '1 min'
|
||||
duration: '-'
|
||||
message: 'commit message 4'
|
||||
|
||||
test "my repos is activated when user signs in", ->
|
||||
|
|
|
@ -7,7 +7,7 @@ module "Travis.Build",
|
|||
Travis.Job.resetData()
|
||||
|
||||
test 'it does not load record on duration, finishedAt and result if job is not in finished state', ->
|
||||
Travis.Build.load [{ id: 1, state: 'started' }]
|
||||
Travis.Build.load [{ id: 1, state: 'started', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Build.find 1
|
||||
|
@ -15,7 +15,7 @@ test 'it does not load record on duration, finishedAt and result if job is not i
|
|||
record.loadTheRest = ->
|
||||
ok(false, 'loadTheRest should not be called')
|
||||
|
||||
record.get('_duration')
|
||||
record.get('duration')
|
||||
record.get('finishedAt')
|
||||
record.get('result')
|
||||
|
||||
|
@ -25,7 +25,7 @@ test 'it does not load record on duration, finishedAt and result if job is not i
|
|||
test 'it loads record on duration, finishedAt and result if job is in finished state', ->
|
||||
expect(1)
|
||||
|
||||
Travis.Build.load [{ id: 1, state: 'passed' }]
|
||||
Travis.Build.load [{ id: 1, state: 'passed', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Build.find 1
|
||||
|
|
|
@ -37,7 +37,7 @@ test 'configKeys takes into account the keys of other jobs', ->
|
|||
deepEqual( configValues3, [ '1.9.3', undefined, undefined, 'OpenJDK' ] )
|
||||
|
||||
test 'it does not load record on duration, finishedAt and result if job is not in finished state', ->
|
||||
Travis.Job.load [{ id: 1, state: 'started' }]
|
||||
Travis.Job.load [{ id: 1, state: 'started', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Job.find 1
|
||||
|
@ -55,7 +55,7 @@ test 'it does not load record on duration, finishedAt and result if job is not i
|
|||
test 'it loads record on duration, finishedAt and result if job is in finished state', ->
|
||||
expect(1)
|
||||
|
||||
Travis.Job.load [{ id: 1, state: 'passed' }]
|
||||
Travis.Job.load [{ id: 1, state: 'passed', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Job.find 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user