Commit 5fdfdc54 5fdfdc547006f4b7205918dd887536e7dd040ad8 by Nicolas Perriault

fixes #119 - HTTP status wasn't properly caught

1 parent fada3d7d
......@@ -4,6 +4,7 @@ CasperJS Changelog
XXXX-XX-XX, v0.6.11
-------------------
- fixed [#119](https://github.com/n1k0/casperjs/issues/119) - HTTP status wasn't properly caught
- fixed [#132](https://github.com/n1k0/casperjs/issues/132) - added ability to include js/coffee files using a dedicated option when using the [`casper test` command](http://casperjs.org/testing.html)
- fixed [#140](https://github.com/n1k0/casperjs/issues/140) - `casper test` now resolves local paths urls
- fixed [#148](https://github.com/n1k0/casperjs/issues/148) - [`utils.isWebPage()`](http://casperjs.org/api.html#utils.isWebPage) was broken
......
......@@ -112,7 +112,7 @@ var Casper = function Casper(options) {
this.cli = phantom.casperArgs;
this.colorizer = this.getColorizer();
this.currentUrl = 'about:blank';
this.currentHTTPStatus = 200;
this.currentHTTPStatus = 0;
this.defaultWaitTimeout = 5000;
this.history = [];
this.loadInProgress = false;
......@@ -1521,7 +1521,7 @@ function createPage(casper) {
if (resource.stage === "end") {
casper.resources.push(resource);
}
if (resource.url === casper.requestUrl && resource.stage === "start") {
if (resource.url === casper.requestUrl && resource.stage === "end") {
casper.currentHTTPStatus = resource.status;
casper.emit('http.status.' + resource.status, resource);
if (utils.isObject(casper.options.httpStatusHandlers) &&
......
......@@ -625,7 +625,7 @@ var Tester = function Tester(casper, options) {
line = ~~failure.line;
message = failure.message;
casper.echo(f('In %s:%s', failure.file, line));
casper.echo(f(' %s: %s', type, message || "(no message was entered)"), "COMMENT");
casper.echo(f(' %s: %s', type, message || failure.standard || "(no message was entered)"), "COMMENT");
});
};
......