Migrated most service tests to use new expectBadge (#3122)

This commit is contained in:
Pierre-Yves B
2019-02-28 21:43:23 +00:00
committed by GitHub
parent 4e2d144f97
commit 1f29c22d3d
230 changed files with 3480 additions and 4439 deletions

View File

@@ -7,9 +7,9 @@ t.create('commit status - commit in branch')
.get(
'/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json?style=_shields_test'
)
.expectJSON({
name: 'commit status',
value: 'in master',
.expectBadge({
label: 'commit status',
message: 'in master',
color: 'brightgreen',
})
@@ -26,9 +26,9 @@ t.create(
)
.reply(200, { status: 'identical' })
)
.expectJSON({
name: 'commit status',
value: 'in master',
.expectBadge({
label: 'commit status',
message: 'in master',
color: 'brightgreen',
})
@@ -36,9 +36,9 @@ t.create('commit status - commit not in branch')
.get(
'/badges/shields/master/960c5bf72d7d1539fcd453343eed3f8617427a41.json?style=_shields_test'
)
.expectJSON({
name: 'commit status',
value: 'commit or branch not found',
.expectBadge({
label: 'commit status',
message: 'commit or branch not found',
color: 'lightgrey',
})
@@ -46,9 +46,9 @@ t.create('commit status - unknown commit id')
.get(
'/atom/atom/v1.27.1/7dfb45eb61a48a4ce18a0dd2e31f944ed4467ae3.json?style=_shields_test'
)
.expectJSON({
name: 'commit status',
value: 'not in v1.27.1',
.expectBadge({
label: 'commit status',
message: 'not in v1.27.1',
color: 'yellow',
})
@@ -56,9 +56,9 @@ t.create('commit status - unknown branch')
.get(
'/badges/shields/this-branch-does-not-exist/b551a3a8daf1c48dba32a3eab1edf99b10c28863.json?style=_shields_test'
)
.expectJSON({
name: 'commit status',
value: 'commit or branch not found',
.expectBadge({
label: 'commit status',
message: 'commit or branch not found',
color: 'lightgrey',
})
@@ -66,9 +66,9 @@ t.create('commit status - no common ancestor between commit and branch')
.get(
'/badges/shields/master/b551a3a8daf1c48dba32a3eab1edf99b10c28863.json?style=_shields_test'
)
.expectJSON({
name: 'commit status',
value: 'no common ancestor',
.expectBadge({
label: 'commit status',
message: 'no common ancestor',
color: 'lightgrey',
})
@@ -83,9 +83,9 @@ t.create('commit status - invalid JSON')
)
.reply(invalidJSON)
)
.expectJSON({
name: 'commit status',
value: 'invalid',
.expectBadge({
label: 'commit status',
message: 'invalid',
color: 'lightgrey',
})
@@ -94,9 +94,9 @@ t.create('commit status - network error')
'/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json?style=_shields_test'
)
.networkOff()
.expectJSON({
name: 'commit status',
value: 'inaccessible',
.expectBadge({
label: 'commit status',
message: 'inaccessible',
color: 'red',
})
@@ -111,9 +111,9 @@ t.create('commit status - github server error')
)
.reply(500)
)
.expectJSON({
name: 'commit status',
value: 'invalid',
.expectBadge({
label: 'commit status',
message: 'invalid',
color: 'lightgrey',
})
@@ -128,9 +128,9 @@ t.create('commit status - 404 with empty JSON form github')
)
.reply(404, {})
)
.expectJSON({
name: 'commit status',
value: 'invalid',
.expectBadge({
label: 'commit status',
message: 'invalid',
color: 'lightgrey',
})
@@ -145,8 +145,8 @@ t.create('commit status - 404 with invalid JSON form github')
)
.reply(404, invalidJSON)
)
.expectJSON({
name: 'commit status',
value: 'invalid',
.expectBadge({
label: 'commit status',
message: 'invalid',
color: 'lightgrey',
})