bitter-apple
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -59,3 +59,13 @@ /* jslint node: true */ | ||
} | ||
callback(); | ||
}); | ||
}); | ||
this.When('I POST to $resource with body', function(resource, bodyValue, callback) { | ||
this.bitterapple.setRequestBody(bodyValue); | ||
this.bitterapple.post(resource, function(error, response) { | ||
if (error) { | ||
callback.fail(error); | ||
} | ||
callback(); | ||
@@ -75,2 +85,13 @@ }); | ||
this.When('I PUT $resource with body', function(resource, bodyValue, callback) { | ||
this.bitterapple.setRequestBody(bodyValue); | ||
this.bitterapple.put(resource, function(error, response) { | ||
if (error) { | ||
callback.fail(error); | ||
} | ||
callback(); | ||
}); | ||
}); | ||
this.When('I DELETE $resource', function(resource, callback) { | ||
@@ -86,2 +107,13 @@ this.bitterapple.delete(resource, function(error, response) { | ||
this.When('I DELETE $resource with body', function(resource, bodyValue, callback) { | ||
this.bitterapple.setRequestBody(bodyValue); | ||
this.bitterapple.delete(resource, function(error, response) { | ||
if (error) { | ||
callback.fail(error); | ||
} | ||
callback(); | ||
}); | ||
}); | ||
this.When('I PATCH $resource', function(resource, callback) { | ||
@@ -97,2 +129,13 @@ this.bitterapple.patch(resource, function(error, response) { | ||
this.When('I PATCH $resource with body', function(resource, bodyValue, callback) { | ||
this.bitterapple.setRequestBody(bodyValue); | ||
this.bitterapple.patch(resource, function(error, response) { | ||
if (error) { | ||
callback.fail(error); | ||
} | ||
callback(); | ||
}); | ||
}); | ||
this.Then(/^response header (.*) should exist$/, function(header, callback) { | ||
@@ -99,0 +142,0 @@ if (this.bitterapple.assertResponseContainsHeader(header)) { |
{ | ||
"name": "bitter-apple", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "Collection of utility functions and a gherkin framework for WEB API integration testing based on cucumber.js", | ||
@@ -5,0 +5,0 @@ "main": "bitter-apple.js", |
30671
565