Permalink
Browse files

Merge pull request #459 from bfirsh/fix-addhandler

Fix addHandler calling non-existent assert
  • Loading branch information...
2 parents 7382fed + 3407395 commit 5a7720109bb8bb3cf743f68294420386749971dc @assaf committed Dec 26, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 lib/zombie/resources.coffee
  2. +9 −0 test/resources_test.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
@@ -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()

0 comments on commit 5a77201

Please sign in to comment.