test/javascript/src/report/report_test.js in puppet-herald-0.2.0 vs test/javascript/src/report/report_test.js in puppet-herald-0.8.0

- old
+ new

@@ -29,19 +29,19 @@ // Get hold of a scope (i.e. the root scope) var $rootScope = $injector.get('$rootScope'); // The $controller service is used to create instances of controllers var $controller = $injector.get('$controller'); - var $routeParams = $injector.get('$routeParams'); + var $stateParams = $injector.get('$stateParams'); Page = $injector.get('Page'); controller = function(id, mockValues) { if (id == null) { id = 1; } if (typeof(mockValues) === 'undefined') { mockValues = defaultMockValues; } - $routeParams.reportId = id; + $stateParams.reportId = id; // backend definition common for all tests var handler = $httpBackend.when('GET', '/api/v1/reports/' + id); if (mockValues != null) { handler.respond(mockValues); } else { @@ -68,13 +68,13 @@ expect(ctrl.report).not.toEqual(null); }); it('should have fetch report with 4 lines', function() { expect(ctrl.report.log_entries.length).toBe(4); }); - it('should set Page.title to "Report: 1234578"', function() { + it('should set Page.title to "Puppet report: 1234578"', function() { expect(ctrl).not.toBe(undefined); - expect(Page.actualTitle()).toEqual('Report'); + expect(Page.actualTitle()).toEqual('Puppet report'); expect(Page.actualTarget()).toBe('1234578'); }); }); describe('fetching data from "/api/v1/reports/12"', function() { var ctrl; @@ -82,12 +82,12 @@ ctrl = controller(12, null); }); it('there should not be report fetched', function() { expect(ctrl.report).toEqual(null); }); - it('should set Page.title to "Report: "', function() { + it('should set Page.title to "Puppet report: "', function() { expect(ctrl).not.toBe(undefined); - expect(Page.actualTitle()).toEqual('Report'); + expect(Page.actualTitle()).toEqual('Puppet report'); expect(Page.actualTarget()).toBe(undefined); }); }); }); }); \ No newline at end of file