0
votes

I want to test the html page title as one of my unit cases in angularJS. The name of my controller is 'MainController'. Can i access the title without the scope of the controller.?

describe('Testing Currency App',function(){ beforeEach(module('currencyConv'));

describe('Testing Currency App Controller',function(){

    var scope = {};
    var ctrl;

    beforeEach(inject(function($controller,$rootScope){
        scope = $rootScope.$new();
        ctrl = $controller('MainController', {$scope:scope});
        rootScope = $rootScope;
    }));


    it('should initialise the title',function(){
        expect(scope.title).toBeDefined();
        expect(scope.title).toBe('Angular Currency Converter');
    });
});

});

I am new at angular

1

1 Answers