Merge pull request #214 from Aaron1011/clear_log

Clear log when a job is restarted
This commit is contained in:
Piotr Sarnacki 2013-10-07 07:41:50 -07:00
commit ae0db5780a
2 changed files with 36 additions and 1 deletions

View File

@ -34,7 +34,7 @@ Travis.reopen
parts.removeArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop')
versionDidChange: (->
@rerender() if @get('inDOM')
@rerender() if @get('state') == 'inDOM'
).observes('log.version')
logDidChange: (->

View File

@ -35,6 +35,40 @@ test "event containing a repository, adds repository to repos list", ->
row: 2
item: { slug: 'travis-ci/travis-support', build: { number: 4, url: '/travis-ci/travis-support/builds/10', duration: '1 min 30 sec', finishedAt: 'less than a minute ago' } }
test "an event containing a created job, clears the job's log", ->
payload =
job:
id: 12
repository_id: 1
number: '1.4'
queue: 'build.linux'
visit('/travis-ci/travis-core/').then ->
Em.run ->
logRendered()
Travis.receive 'build:created', payload
wait().then ->
displaysLog []
test "an event containing a requeued job, clears the job's log", ->
payload =
job:
id: 12
repository_id: 1
number: '1.4'
queue: 'build.linux'
visit('/travis-ci/travis-core').then ->
Em.run ->
logRendered()
Travis.receive 'build:requeued', payload
wait().then ->
displaysLog []
test "an event with a build adds a build to a builds list", ->
visit('/travis-ci/travis-core/builds').then ->
payload =
@ -62,6 +96,7 @@ test "an event with a build adds a build to a builds list", ->
row: 1
item: { id: 11, slug: 'travis-ci/travis-core', number: '3', sha: '1234567', branch: 'master', message: 'commit message 3', finishedAt: 'less than a minute ago', duration: '55 sec', color: 'red' }
#test "event containing a job, adds job to jobs list", ->
# visit('travis-ci/travis-core').then ->
# payload =