Created
December 10, 2013 23:51
-
-
Save willrjmarshall/7902546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'OrderCycle service', -> | |
$httpBackend = null | |
OrderCycle = null | |
Product = { | |
all: -> {} | |
} | |
beforeEach ($provide)-> | |
module 'Shop' | |
$provide.value('Product', Product); | |
inject ($injector, _$httpBackend_, Product)-> | |
OrderCycle = $injector.get("OrderCycle") | |
$httpBackend = _$httpBackend_ | |
it "posts the order_cycle ID and tells product to update", -> | |
$httpBackend.expectPOST("/shop/order_cycle", {"order_cycle_id" : 10}).respond(200) | |
$httpBackend.expectGET("/shop/products").respond(200) | |
OrderCycle.set_order_cycle(10) | |
$httpBackend.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment