Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix addHandler calling non-existent assert #459

Merged
merged 1 commit into from

2 participants

@bfirsh

No description provided.

@assaf assaf merged commit 5a77201 into assaf:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 26, 2012
  1. @bfirsh
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 0 deletions.
  1. +1 −0  lib/zombie/resources.coffee
  2. +9 −0 test/resources_test.coffee
View
1  lib/zombie/resources.coffee
@@ -23,6 +23,7 @@ QS = require("querystring")
Request = require("request")
URL = require("url")
Zlib = require("zlib")
+assert = require("assert")
# Each browser has a resources object that provides the means for retrieving
View
9 test/resources_test.coffee
@@ -144,6 +144,15 @@ describe "Resources", ->
it "should include loaded JavaScript", ->
assert.equal browser.resources[1].response.url, "http://localhost:3003/jquery-1.7.1.js"
+ describe "addHandler", ->
+ before (done) ->
+ browser.resources.addHandler (request, done) ->
+ done(null, statusCode: 204, body: "empty")
+ browser.visit("/resources/resource", done)
+
+ it "should call the handler and use its response", ->
+ browser.assert.status 204
+ browser.assert.text "body", "empty"
after ->
browser.destroy()
Something went wrong with that request. Please try again.