Skip to content

Commit cce1475

Browse files
committed
updated tests and changed all routeparams to stateparams
1 parent a60eeab commit cce1475

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.jshintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/coverage/**

public/js/controllers/articles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
angular.module('mean.articles').controller('ArticlesController', ['$scope', '$routeParams', '$location', 'Global', 'Articles', function ($scope, $routeParams, $location, Global, Articles) {
3+
angular.module('mean.articles').controller('ArticlesController', ['$scope', '$stateParams', '$location', 'Global', 'Articles', function ($scope, $stateParams, $location, Global, Articles) {
44
$scope.global = Global;
55

66
$scope.create = function() {
@@ -52,7 +52,7 @@ angular.module('mean.articles').controller('ArticlesController', ['$scope', '$ro
5252

5353
$scope.findOne = function() {
5454
Articles.get({
55-
articleId: $routeParams.articleId
55+
articleId: $stateParams.articleId
5656
}, function(article) {
5757
$scope.article = article;
5858
});

test/karma/karma.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ module.exports = function(config) {
2020
'public/lib/angular-mocks/angular-mocks.js',
2121
'public/lib/angular-cookies/angular-cookies.js',
2222
'public/lib/angular-resource/angular-resource.js',
23-
'public/lib/angular-route/angular-route.js',
23+
'public/lib/angular-ui-router/release/angular-ui-router.js',
2424
'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
2525
'public/lib/angular-bootstrap/ui-bootstrap.js',
26-
'public/lib/angular-ui-utils/modules/route/route.js',
2726
'public/js/app.js',
2827
'public/js/config.js',
2928
'public/js/directives.js',

test/karma/unit/controllers/articles.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
var ArticlesController,
2525
scope,
2626
$httpBackend,
27-
$routeParams,
27+
$stateParams,
2828
$location;
2929

3030
// The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).
3131
// This allows us to inject a service but then attach it to a variable
3232
// with the same name as the service.
33-
beforeEach(inject(function($controller, $rootScope, _$location_, _$routeParams_, _$httpBackend_) {
33+
beforeEach(inject(function($controller, $rootScope, _$location_, _$stateParams_, _$httpBackend_) {
3434

3535
scope = $rootScope.$new();
3636

3737
ArticlesController = $controller('ArticlesController', {
3838
$scope: scope
3939
});
4040

41-
$routeParams = _$routeParams_;
41+
$stateParams = _$stateParams_;
4242

4343
$httpBackend = _$httpBackend_;
4444

@@ -70,7 +70,7 @@
7070
it('$scope.findOne() should create an array with one article object fetched ' +
7171
'from XHR using a articleId URL parameter', function() {
7272
// fixture URL parament
73-
$routeParams.articleId = '525a8422f6d0f87f0e407a33';
73+
$stateParams.articleId = '525a8422f6d0f87f0e407a33';
7474

7575
// fixture response object
7676
var testArticleData = function() {

0 commit comments

Comments
 (0)