From 615edb56861b7f167c5c193b1c4aff0d7dccd5ce Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 14 Aug 2014 18:44:30 +0200 Subject: [PATCH] Fix specs For some reason mocked ajax queries don't fire when build page is opened directly in specs. I don't want to go into detail at this point, because I plan rewriting build/job related views and controllers to decouple repo controller anyway, which should fix some of the oddities. --- .../spec/integration/build_spec.coffee | 89 ++++++++++--------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/assets/scripts/spec/integration/build_spec.coffee b/assets/scripts/spec/integration/build_spec.coffee index d5640cff..9716d7f4 100644 --- a/assets/scripts/spec/integration/build_spec.coffee +++ b/assets/scripts/spec/integration/build_spec.coffee @@ -5,52 +5,53 @@ module "Build page", Ember.run -> Travis.reset() test "displaying information on build page", -> - visit('/travis-ci/travis-core/builds/1').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' } } - ] - - displaysRepository - href: '/travis-ci/travis-core' - - displaysSummary - type: 'build' - id: 1 - repo: 'travis-ci/travis-core' - commit: '1234567' - branch: 'master' - compare: '0123456..1234567' - finishedAt: '3 minutes ago' - duration: '30 sec' - message: 'commit message 1' - - displaysSummaryGravatars - authorEmail: 'author@email.com' - committerEmail: 'committer@email.com' - - - displaysTabs - current: { href: '/travis-ci/travis-core' } - builds: { href: '/travis-ci/travis-core/builds' } - build: { href: '/travis-ci/travis-core/builds/1', active: true } - job: { hidden: true } - - listsJobs - table: '#jobs' - headers: ['Job', 'Duration', 'Finished', 'Ruby'] - jobs: [ - { color: 'green', id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' } - { color: 'red', id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' } + visit('/travis-ci/travis-core/builds').then -> + visit('/travis-ci/travis-core/builds/1').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' } } ] - listsJobs - table: '#allowed_failure_jobs' - headers: ['Job', 'Duration', 'Finished', 'Ruby'] - jobs: [ - { color: '', id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' } - ] + displaysRepository + href: '/travis-ci/travis-core' + + displaysSummary + type: 'build' + id: 1 + repo: 'travis-ci/travis-core' + commit: '1234567' + branch: 'master' + compare: '0123456..1234567' + finishedAt: '3 minutes ago' + duration: '30 sec' + message: 'commit message 1' + + displaysSummaryGravatars + authorEmail: 'author@email.com' + committerEmail: 'committer@email.com' + + + displaysTabs + current: { href: '/travis-ci/travis-core' } + builds: { href: '/travis-ci/travis-core/builds' } + build: { href: '/travis-ci/travis-core/builds/1', active: true } + job: { hidden: true } + + listsJobs + table: '#jobs' + headers: ['Job', 'Duration', 'Finished', 'Ruby'] + jobs: [ + { color: 'green', id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' } + { color: 'red', id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' } + ] + + listsJobs + table: '#allowed_failure_jobs' + headers: ['Job', 'Duration', 'Finished', 'Ruby'] + jobs: [ + { color: '', id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' } + ] test "updating current build", -> visit('/travis-ci/travis-core').then ->