Fix bug in distanceBetween, update docs, deal with null queries

This commit is contained in:
Rohan Mitchell
2015-07-02 11:50:29 +10:00
parent 9fb7c47c73
commit befcc37456
3 changed files with 13 additions and 9 deletions

View File

@@ -93,6 +93,11 @@ describe "Enterprises service", ->
Enterprises.updateDistance "asdf"
expect(Enterprises.calculateDistance).toHaveBeenCalledWith("asdf")
it "resets the distance when query is null", ->
spyOn(Enterprises, "resetDistance")
Enterprises.updateDistance null
expect(Enterprises.resetDistance).toHaveBeenCalled()
it "resets the distance when query is blank", ->
spyOn(Enterprises, "resetDistance")
Enterprises.updateDistance ""