aboutsummaryrefslogtreecommitdiffstats
path: root/test/scenario/dslSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-11-08 17:40:52 -0800
committerMisko Hevery2011-11-14 20:31:15 -0800
commit9c0639437607a4fcea379bbaf610600d05d8a9b7 (patch)
tree1ae90d93d0139f7791487fe814360904254d39cb /test/scenario/dslSpec.js
parent085e3c611fd0cd48757702c50c67b551a00a0d38 (diff)
downloadangular.js-9c0639437607a4fcea379bbaf610600d05d8a9b7.tar.bz2
chore(scenario tests): make scenario tests pass again
Diffstat (limited to 'test/scenario/dslSpec.js')
-rw-r--r--test/scenario/dslSpec.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js
index 411320e8..29956801 100644
--- a/test/scenario/dslSpec.js
+++ b/test/scenario/dslSpec.js
@@ -4,13 +4,14 @@ describe("angular.scenario.dsl", function() {
var $window, $root;
var application, eventLog;
- beforeEach(function() {
+ beforeEach(inject(function($injector) {
eventLog = [];
$window = {
- document: _jQuery("<div></div>"),
+ document: jqLite('<div class="document"></div>'),
angular: new angular.scenario.testing.MockAngular()
};
- $root = angular.injector('NG')('$rootScope');
+ $window.document.data('$injector', $injector);
+ $root = $injector('$rootScope');
$root.emit = function(eventName) {
eventLog.push(eventName);
};
@@ -45,6 +46,10 @@ describe("angular.scenario.dsl", function() {
// Just use the real one since it delegates to this.addFuture
$root.addFutureAction = angular.scenario.
SpecRunner.prototype.addFutureAction;
+ }));
+
+ afterEach(function(){
+ jqLite($window.document).removeData('$injector');
});
describe('Pause', function() {
@@ -201,11 +206,14 @@ describe("angular.scenario.dsl", function() {
// ex. jQuery('#foo').find('[name="bar"]') // fails
// ex. jQuery('#foo [name="bar"]') // works, wtf?
//
- beforeEach(function() {
+ beforeEach(inject(function($injector) {
doc = _jQuery('<div id="angular-scenario-binding"></div>');
_jQuery(document.body).html('').append(doc);
- $window.document = window.document;
- });
+
+ dealoc($window.document); // we are about to override it
+ $window.document = window.document;
+ jqLite($window.document).data('$injector', $injector);
+ }));
afterEach(function() {
_jQuery(document.body).