Remove buts

This commit is contained in:
John Cowen 2018-06-07 12:35:37 +01:00
parent 29196d3f49
commit e34eec4bef
1 changed files with 11 additions and 25 deletions

View File

@ -136,21 +136,15 @@ export default function(assert) {
assert.equal( assert.equal(
request.method, request.method,
method, method,
`Expected the request method to be ${method} but was ${request.method}` `Expected the request method to be ${method}, was ${request.method}`
);
assert.equal(
request.url,
url,
`Expected the request url to be ${url} but was ${request.url}`
); );
assert.equal(request.url, url, `Expected the request url to be ${url}, was ${request.url}`);
const body = JSON.parse(request.requestBody); const body = JSON.parse(request.requestBody);
Object.keys(data).forEach(function(key, i, arr) { Object.keys(data).forEach(function(key, i, arr) {
assert.equal( assert.equal(
body[key], body[key],
data[key], data[key],
`Expected the payload to contain ${key} to equal ${body[key]} but ${key} was ${ `Expected the payload to contain ${key} to equal ${body[key]}, ${key} was ${data[key]}`
data[key]
}`
); );
}); });
}) })
@ -163,18 +157,14 @@ export default function(assert) {
assert.equal( assert.equal(
request.method, request.method,
method, method,
`Expected the request method to be ${method} but was ${request.method}` `Expected the request method to be ${method}, was ${request.method}`
);
assert.equal(
request.url,
url,
`Expected the request url to be ${url} but was ${request.url}`
); );
assert.equal(request.url, url, `Expected the request url to be ${url}, was ${request.url}`);
const body = request.requestBody; const body = request.requestBody;
assert.equal( assert.equal(
body, body,
data, data,
`Expected the request body to be ${body} but was ${request.requestBody}` `Expected the request body to be ${body}, was ${request.requestBody}`
); );
}) })
.then('a $method request is made to "$url"', function(method, url) { .then('a $method request is made to "$url"', function(method, url) {
@ -182,17 +172,13 @@ export default function(assert) {
assert.equal( assert.equal(
request.method, request.method,
method, method,
`Expected the request method to be ${method} but was ${request.method}` `Expected the request method to be ${method}, was ${request.method}`
);
assert.equal(
request.url,
url,
`Expected the request url to be ${url} but was ${request.url}`
); );
assert.equal(request.url, url, `Expected the request url to be ${url}, was ${request.url}`);
}) })
.then('the url should be $url', function(url) { .then('the url should be $url', function(url) {
const current = currentURL(); const current = currentURL();
assert.equal(current, url, `Expected the url to be ${url} but was ${current}`); assert.equal(current, url, `Expected the url to be ${url} was ${current}`);
}) })
.then(['I see $num $model', 'I see $num $model model', 'I see $num $model models'], function( .then(['I see $num $model', 'I see $num $model model', 'I see $num $model models'], function(
num, num,
@ -202,7 +188,7 @@ export default function(assert) {
return item.isVisible; return item.isVisible;
}).length; }).length;
assert.equal(len, num, `Expected ${num} ${model}s but saw ${len}`); assert.equal(len, num, `Expected ${num} ${model}s, saw ${len}`);
}) })
.then(['I see $num $model model with the $property "$value"'], function( .then(['I see $num $model model with the $property "$value"'], function(
num, num,
@ -216,7 +202,7 @@ export default function(assert) {
assert.equal( assert.equal(
len, len,
num, num,
`Expected ${num} ${model}s with ${property} set to "${value}" but saw ${len}` `Expected ${num} ${model}s with ${property} set to "${value}", saw ${len}`
); );
}) })
.then(['I see $property on the $component'], function(property, component) { .then(['I see $property on the $component'], function(property, component) {