Created
January 4, 2012 19:24
-
-
Save thruflo/1561585 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
# Jasmine specs for controllers go here | |
describe 'PhoneCat controllers', -> | |
describe 'PhoneListCtrl', -> | |
data = [name: 'Nexus S', name: 'Motorola DROID'] | |
beforeEach => | |
@scope = angular.scope() | |
@browser = @scope.$service '$browser' | |
request = @browser.xhr.expectGET 'phones/phones.json' | |
request.respond data | |
@ctrl = @scope.$new PhoneListCtrl | |
it 'should create "phones" model with 2 phones fetched from xhr', => | |
expect(@ctrl.phones).toBeUndefined() | |
@browser.xhr.flush() | |
expect(@ctrl.phones).toEqual data | |
it 'should set the default value of orderProp model', => | |
expect(@ctrl.orderProp).toBe 'age' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment