Getting the tests working once more

This commit is contained in:
Will Marshall
2014-03-27 12:07:38 +11:00
parent 67762317cb
commit 17bb1f9d25
6 changed files with 25 additions and 32 deletions

View File

@@ -6,8 +6,8 @@ describe "SidebarCtrl", ->
beforeEach ->
module("Darkswarm")
location =
hash: ->
"sidebar"
path: ->
"/login"
inject ($controller, $rootScope) ->
scope = $rootScope
ctrl = $controller 'SidebarCtrl', {$scope: scope, $location: location}
@@ -17,6 +17,6 @@ describe "SidebarCtrl", ->
expect(scope.active()).toEqual true
it 'is inactive no location is set', ->
location.hash = ->
location.path = ->
null
expect(scope.active()).toEqual false

View File

@@ -32,3 +32,13 @@ describe 'OrderCycle service', ->
$httpBackend.flush()
expect(OrderCycle.order_cycle.orders_close_at).toEqual(datestring)
it "tells us when the order cycle closes", ->
OrderCycle.order_cycle.orders_close_at = "test"
expect(OrderCycle.orders_close_at()).toEqual "test"
it "tells us when no order cycle is selected", ->
OrderCycle.order_cycle = null
expect(OrderCycle.selected()).toEqual false
OrderCycle.order_cycle = {test: "blah"}
expect(OrderCycle.selected()).toEqual true