fix test
This commit is contained in:
parent
a5c3cf69f2
commit
9052ec133c
|
@ -2,12 +2,5 @@
|
||||||
|
|
||||||
Route = TravisRoute.extend
|
Route = TravisRoute.extend
|
||||||
needsAuth: true
|
needsAuth: true
|
||||||
# activate: ->
|
|
||||||
# @get('stylesheetsManager').disable('main')
|
|
||||||
# @get('stylesheetsManager').enable('dashboard')
|
|
||||||
|
|
||||||
# deactivate: ->
|
|
||||||
# @get('stylesheetsManager').enable('main')
|
|
||||||
# @get('stylesheetsManager').disable('dashboard')
|
|
||||||
|
|
||||||
`export default Route`
|
`export default Route`
|
||||||
|
|
|
@ -13,44 +13,72 @@ module 'Acceptance: Dashboard',
|
||||||
server = new Pretender ->
|
server = new Pretender ->
|
||||||
@get('/v3/repos', (request) ->
|
@get('/v3/repos', (request) ->
|
||||||
data = {
|
data = {
|
||||||
"@type": "repositories",
|
"repositories": [
|
||||||
"repositories": [{
|
|
||||||
"@type": "repository",
|
"@type": "repository",
|
||||||
"active": true,
|
"@href": "/v3/repo/4289199",
|
||||||
"id": 1,
|
"@representation": "standard",
|
||||||
"name": "travis-web",
|
"@permissions": {
|
||||||
"slug": "travis-ci/travis-web",
|
"read": true,
|
||||||
"description": "The Ember web client for Travis CI",
|
"enable": true,
|
||||||
"github_language": "CoffeeScript",
|
"disable": true,
|
||||||
"private": false,
|
"create_request": true
|
||||||
"owner": {
|
|
||||||
"@type": "organization",
|
|
||||||
"id": 1,
|
|
||||||
"login": "travis-ci"
|
|
||||||
},
|
},
|
||||||
"last_build": {
|
"id": 4289199,
|
||||||
"@type": "build",
|
"name": "jupiter-brain",
|
||||||
"id": 1,
|
"slug": "travis-ci/jupiter-brain",
|
||||||
"number": "1",
|
"description": "Jupiter Brain manages servers",
|
||||||
"state": "passed",
|
"github_language": "Go",
|
||||||
"duration": 20,
|
|
||||||
"started_at": "2015-02-05T09:58:31Z",
|
|
||||||
"finished_at": "2015-02-05T10:09:10Z"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"@type": "repository",
|
|
||||||
"active": true,
|
"active": true,
|
||||||
"id": 2,
|
|
||||||
"name": "travis-test",
|
|
||||||
"slug": "travis-ci/travis-test",
|
|
||||||
"private": false,
|
"private": false,
|
||||||
"owner": {
|
"owner": {
|
||||||
"@type": "organization",
|
"@type": "organization",
|
||||||
"id": 87,
|
"id": 87,
|
||||||
"login": "travis-ci"
|
"login": "travis-ci",
|
||||||
|
"@href": "/v3/org/87"
|
||||||
},
|
},
|
||||||
"last_build": null
|
"default_branch": {
|
||||||
}]
|
"@type": "branch",
|
||||||
|
"@href": "/v3/repo/4289199/branch/master",
|
||||||
|
"@representation": "standard",
|
||||||
|
"name": "master",
|
||||||
|
"repository": {
|
||||||
|
"@href": "/v3/repo/4289199"
|
||||||
|
},
|
||||||
|
"default_branch": true,
|
||||||
|
"exists_on_github": true,
|
||||||
|
"last_build": {
|
||||||
|
"@type": "build",
|
||||||
|
"@href": "/v3/build/81667484",
|
||||||
|
"@representation": "minimal",
|
||||||
|
"id": 81667484,
|
||||||
|
"number": "77",
|
||||||
|
"state": "passed",
|
||||||
|
"duration": 107,
|
||||||
|
"event_type": "push",
|
||||||
|
"previous_state": "passed",
|
||||||
|
"started_at": "2015-09-22T20:56:03Z",
|
||||||
|
"finished_at": "2015-09-22T20:57:50Z",
|
||||||
|
"commit": {
|
||||||
|
"@type": "commit",
|
||||||
|
"@representation": "standard",
|
||||||
|
"id": 23259185,
|
||||||
|
"sha": "39f658654f2d458af074b600d11e47547988ee56",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"message": "Merge pull request #6 from travis-ci/hh-circuit-breaker\n\nvsphere: add circuit breaker between Jupiter Brain and vSphere",
|
||||||
|
"compare_url": "https://github.com/travis-ci/jupiter-brain/compare/923f220a494f...39f658654f2d",
|
||||||
|
"committed_at": "2015-09-22T20:55:43Z",
|
||||||
|
"committer": {
|
||||||
|
"name": "emma trimble",
|
||||||
|
"avatar_url": "https://0.gravatar.com/avatar/e3058e8bba1f2b87defccd5695070782"
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"name": "emma trimble",
|
||||||
|
"avatar_url": "https://0.gravatar.com/avatar/e3058e8bba1f2b87defccd5695070782"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
return [200, { "Content-Type": "application/json" }, JSON.stringify(data)]
|
return [200, { "Content-Type": "application/json" }, JSON.stringify(data)]
|
||||||
)
|
)
|
||||||
|
@ -64,4 +92,4 @@ test 'visiting /dashboard', ->
|
||||||
|
|
||||||
andThen ->
|
andThen ->
|
||||||
equal find('.dashboard-active .dashboard-row').length, 1, 'there should be one repo displayed on dashboard'
|
equal find('.dashboard-active .dashboard-row').length, 1, 'there should be one repo displayed on dashboard'
|
||||||
equal find('.dashboard-active .dashboard-row h2').text(), 'travis-web', 'travis-web repository should be displayed'
|
equal find('.dashboard-active .dashboard-row h2').text(), 'jupiter-brain', 'jupiter-brain repository should be displayed'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user