Skip to content

Commit

Permalink
Fix issue 24, search and hash must be empty string not null.
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Jan 3, 2011
1 parent 2e7a1a6 commit 4d1aa6e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Expand Up @@ -15,13 +15,15 @@ Support `select` with multiple options (José Valim).

Fix handling of unknown input fields and select fields (José Valim).

Fix issue 24, search and hash must be empty string not null.

Support Node 0.3.3 (thanks [Pete Bevin](http://www.petebevin.com/))

For the brave enough to hack a Zombie, we now support (and `cake setup`
assumes) `npm bundle`.

213 Tests
2.8 sec to complete
220 Tests
2.7 sec to complete


### Version 0.8.6 2010-12-31
Expand Down
10 changes: 10 additions & 0 deletions spec/history-spec.coffee
Expand Up @@ -144,6 +144,16 @@ vows.describe("History").addBatch(
"should not change location URL": (browser)-> assert.equal browser.location, "http://localhost:3003/"
"should reload document": (browser)-> assert.match browser.html(), /Tap, Tap/
"should reload document in new window": (browser)-> assert.ok browser.window != @window
"components":
zombie.wants "http://localhost:3003/"
topic: (browser)-> browser.location
"should include protocol": (location)-> assert.equal location.protocol, "http:"
"should include hostname": (location)-> assert.equal location.hostname, "localhost"
"should include port": (location)-> assert.equal location.port, 3003
"should include hostname and port": (location)-> assert.equal location.host, "localhost:3003"
"should include pathname": (location)-> assert.equal location.pathname, "/"
"should include search": (location)-> assert.equal location.search, ""
"should include hash": (location)-> assert.equal location.hash, ""

"redirect":
zombie.wants "http://localhost:3003/redirect"
Expand Down
2 changes: 1 addition & 1 deletion src/zombie/history.coffee
Expand Up @@ -266,7 +266,7 @@ class Location
# Getter/setter for location parts.
for prop in ["hash", "host", "hostname", "pathname", "port", "protocol", "search"]
do (prop)=>
@__defineGetter__ prop, -> url?[prop]
@__defineGetter__ prop, -> url?[prop] || ""
@__defineSetter__ prop, (value)->
newUrl = URL.parse(url?.href)
newUrl[prop] = value
Expand Down

0 comments on commit 4d1aa6e

Please sign in to comment.