diff --git a/spec/basic/synchronize_spec.js b/spec/basic/synchronize_spec.js index 3378bd3b9..c19ca850b 100644 --- a/spec/basic/synchronize_spec.js +++ b/spec/basic/synchronize_spec.js @@ -1,6 +1,6 @@ var util = require('util'); -describe('synchronizing with slow pages', function() { +ddescribe('synchronizing with slow pages', function() { beforeEach(function() { browser.get('index.html#/async'); }); @@ -72,4 +72,15 @@ describe('synchronizing with slow pages', function() { expect(status.getText()).toEqual('done'); }); + + it('waits for slow routing changes', function() { + var status = element(by.binding('routingChangeStatus')); + var button = element(by.css('[ng-click="routingChange()"]')); + + expect(status.getText()).toEqual('not started'); + + button.click(); + + expect(browser.getPageSource()).toMatch('polling mechanism'); + }); }); diff --git a/testapp/app.js b/testapp/app.js index 2f786c46b..6f27cf3b9 100644 --- a/testapp/app.js +++ b/testapp/app.js @@ -10,5 +10,14 @@ angular.module('myApp', ['ngRoute', 'myApp.appVersion']). $routeProvider.when('/async', {templateUrl: 'async/async.html', controller: AsyncCtrl}); $routeProvider.when('/conflict', {templateUrl: 'conflict/conflict.html', controller: ConflictCtrl}); $routeProvider.when('/polling', {templateUrl: 'polling/polling.html', controller: PollingCtrl}); + $routeProvider.when('/slowloader', { + templateUrl: 'polling/polling.html', + controller: PollingCtrl, + resolve: { + slow: function($timeout) { + return $timeout(function() {}, 2000); + } + } + }); $routeProvider.otherwise({redirectTo: '/form'}); }]); diff --git a/testapp/async/async.html b/testapp/async/async.html index 65c037fff..427b4b914 100644 --- a/testapp/async/async.html +++ b/testapp/async/async.html @@ -24,4 +24,8 @@ +