'use strict';

/* jasmine specs for controllers go here */
describe('PhoneCat controllers', function(){

	describe('PhoneListCtrl', function() {

	  beforeEach(module('phonecatApp'));

	  it('should create "phones" model with 3 phones', inject(function($controller){

	  	var scope = {},
	  		ctrl = $controller('PhoneListCtrl',{$scope:scope});
	  		expect(scope.phones.length).toBe(3);
	  }));

	});
});
@@ -138,17 +138,49 @@
 ion() %7B%0A
+%09%09var scope, ctrl, $httpBackend;
 %0A
-
 %09  befor
@@ -216,74 +216,63 @@
 %0A%0A%09 
- it('should create %22phones%22 model with 3 phones', inject(function(
+%09beforeEach(inject(function(_$httpBackend_,$rootScope, 
 $con
@@ -283,34 +283,183 @@
 ler)
+ 
 %7B%0A
-%0A
 %09 
- %09var scope = %7B%7D,
+%09%09$httpBackend = _$httpBackend_;%0A%09 %09%09$httpBackend.expectGET('phones/phones.json').respond(%5B%7Bname: 'Nexus S'%7D,%7Bname: 'Motorola DROID'%7D%5D);%0A%09 %09%09scope = $rootScope.$new();
 %0A%09 
- 
 %09%09ct
@@ -499,16 +499,17 @@
 %7B$scope:
+ 
 scope%7D);
@@ -515,56 +515,369 @@
 ;%0A%09 
- %09%09expect(scope.phones.length
+%09%7D));%0A%09 %09it('should create %22phones%22 model with 2 phones fetched from xhr', function() %7B%0A%09 %09%09expect(scope.phones).toBeUndefined();%0A%09 %09%09$httpBackend.flush();%0A%09 %09%09expect(scope.phones).toEqual(%5B%7Bname: 'Nexus S'%7D,%7Bname : 'Motorola DROID'%7D%5D);%0A%09 %09%7D);%0A%09 %09it('should set the default value of orderProp model', function() %7B%0A%09 %09%09expect(scope.orderProp
 ).toBe(
-3
+'age'
 );%0A%09 
- %7D));%0A
+%09%7D);
 %0A%09%7D)

test app overview