travis-web/assets/scripts/spec/integration/my_repos_spec.coffee
Piotr Sarnacki 018eafe84b Fix problem with getting started template rendering on first sync
When first sync template is displayed, user usually doesn't have any
repos, which also triggers rendering of getting started template. The
fix for this is to handle the action to render getting started page on
first sync and do nothing in such case.

I also added a test to ensure that it works correctly.
2013-10-29 20:48:27 +01:00

45 lines
1.8 KiB
CoffeeScript

module "My repos",
setup: ->
Ember.run -> Travis.advanceReadiness()
teardown: ->
Ember.run -> Travis.reset()
test "my repos is active by default when user is signed in", ->
Ember.run -> signInUser()
visit('/').then ->
wait().then ->
listsRepos [
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
]
displaysRepository
href: '/travis-ci/travis-hub'
displaysSummary
type: 'build'
id: 4
repo: 'travis-ci/travis-hub'
commit: '4567890'
branch: 'master'
compare: '0123456..4567890'
finishedAt: '-'
duration: '1 min'
message: 'commit message 4'
test "my repos is activated when user signs in", ->
visit('/').then ->
listsRepos [
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
]
Ember.run -> signInUser()
wait().then ->
listsRepos [
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
]