+++ /dev/null
-(function() {
- 'use strict';
-
- angular
- .module('app')
- .config([
- '$stateProvider',
- '$urlRouterProvider',
-
- function($stateProvider, $urlRouterProvider) {
- var welcome = {
- abstract: false,
- url: '/welcome',
- templateUrl: 'app/welcome/welcome.html'
- };
-
- $urlRouterProvider.otherwise('welcome');
- $stateProvider.state('welcome', welcome);
- }
- ]);
-}());
describe('app.welcome', function() {
'use strict';
- var controller, scope;
+ var controller;
+ var scope;
beforeEach(function() {
module('app.welcome');
(function() {
'use strict';
- angular.module('app.welcome', []);
+ angular.module('app.welcome', [
+ 'app.core'
+ ]);
})();
--- /dev/null
+(function() {
+ 'use strict';
+
+ angular
+ .module('app.welcome')
+ .config(configure);
+
+ /**
+ * @ngdoc object
+ * @name app.welcome.$configure
+ *
+ * @requires $stateProvider
+ * @requires $urlRouterProvider
+ *
+ * @description
+ * Router configuration for welcome application.
+ */
+ /* @ngInject */
+ function configure($stateProvider, $urlRouterProvider) {
+ var state = 'welcome';
+ var config = {
+ abstract: false,
+ url: '/welcome',
+ templateUrl: 'app/welcome/welcome.html'
+ };
+
+ $urlRouterProvider.otherwise(state);
+ $stateProvider.state(state, config);
+ }
+}());
--- /dev/null
+describe('app.welcome', function() {
+ 'use strict';
+
+ describe('state', function() {
+ var view = {
+ welcome: 'app/welcome/welcome.html'
+ };
+ var $state;
+
+ beforeEach(function() {
+ module('app.welcome');
+
+ inject(function(_$state_) {
+ $state = _$state_;
+ });
+ });
+
+ it('should map /welcome route to welcome View template', function() {
+ expect($state.get('welcome').templateUrl). toEqual(view.welcome);
+ });
+
+ });
+
+});
<!-- build:js(.) js/app.min.js -->
<!-- inject:js -->
<script src="/src/showcase/app/welcome/welcome.module.js"></script>
+ <script src="/src/showcase/app/welcome/welcome.route.js"></script>
<script src="/src/showcase/app/welcome/welcome.controller.js"></script>
- <script src="/src/showcase/app/app.module.js"></script>
- <script src="/src/showcase/app/app.config.js"></script>
<script src="/src/showcase/app/core/core.module.js"></script>
+ <script src="/src/showcase/app/app.module.js"></script>
<!-- endinject -->