Commit 174c8142 174c8142691f1b0b57e2724c16e4297f6350d9f7 by Nicolas Perriault

added Tester.assertHttpStatus() for testing HTTP status code

1 parent 92e1f714
......@@ -160,7 +160,7 @@ var Tester = function(casper, options) {
* Asserts that an element matching the provided CSS3 selector exists in
* remote DOM.
*
* @param String selector CSS3 selectore
* @param String selector CSS3 selector
* @param String message Test description
*/
this.assertExists = function assertExists(selector, message) {
......@@ -168,6 +168,16 @@ var Tester = function(casper, options) {
};
/**
* Asserts that current HTTP status is the one passed as argument.
*
* @param Number status HTTP status code
* @param String message Test description
*/
this.assertHttpStatus = function assertHttpStatus(status, message) {
return this.assertEquals(casper.currentHTTPStatus, status, message || f("HTTP status code is %d", status));
};
/**
* Asserts that a provided string matches a provided RegExp pattern.
*
* @param String subject The string to test
......