Hi everyone,

<!- index.html-->
<html ng-app = "myApp'>
.............
............
<p ng-controller= "myCtrl">
<div class='aDiv'>
<h3> Hello {{expression}}</h3>
</div>
</p>
</html>
//myCtrl.js
amgular.module('myApp,[])
.controller('myCtrl',[]){

function myCtrl ($scope){ 


$scope.expression = "world";

} 

}

 

//myCtrl.spec.js
describe('unit testing expressions', function(){

var $rootscoope, $compile; 

beforeEach(module('myApp'));
beforeEach(inject(function(_$rootscope_, _$compile_){
$rootsope =  _$rootscope_;
$compile = _$compile_;
});
.......
.......
.......
it('should display the text', function(){
var elem = $compile('<div class = 
'aDiv'><h3>Hello{{expression}}</h3></div>)($rootscope);
expect(elem.find(h3).text()).toBe('hello world');
});
})

 
so how do I write a jasmine test case to check whether the {{expression}}'s 
value is also displayed when the web app is loading. that is the 
$scope.expression = 'world'; is getting displayed when the app is loading, 
but how do I write a jasmine test case to check whether it is loaded? Can 
you please help me with this?

Thanks,
Varun Krishna. P

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to