-
-
Save hunanboy/2b2f71a8f9710d2c1e06 to your computer and use it in GitHub Desktop.
Jasmine test spec for AngularJS official tutorial in JavaScript
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
'use strict'; | |
/* jasmine specs for controllers go here */ | |
describe('PhoneCat controllers', function() { | |
describe('PhoneListCtrl', function($controller){ | |
var scope, ctrl; | |
beforeEach(module('phonecatApp')); | |
beforeEach(inject(function($controller, $rootScope) { | |
scope = $rootScope.$new(); | |
ctrl = $controller('PhoneListCtrl', { | |
$scope: scope | |
}); | |
})); | |
it('should create "phones" model with 3 phones', function() { | |
expect(scope.phones.length).toBe(3); | |
}); | |
it('name is world', function() { | |
expect(scope.name).toBe('World'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment