ember-source 2.9.1 → 2.9.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 2.10.0-beta.2
9
+ * @version 2.9.1
10
10
  */
11
11
 
12
12
  var enifed, requireModule, require, Ember;
@@ -112,85 +112,12 @@ var mainContext = this;
112
112
  }
113
113
  })();
114
114
 
115
- var babelHelpers;
116
-
117
- function classCallCheck(instance, Constructor) {
118
- if (!(instance instanceof Constructor)) {
119
- throw new TypeError('Cannot call a class as a function');
120
- }
121
- }
122
-
123
- function inherits(subClass, superClass) {
124
- if (typeof superClass !== 'function' && superClass !== null) {
125
- throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
126
- }
127
-
128
- subClass.prototype = Object.create(superClass && superClass.prototype, {
129
- constructor: {
130
- value: subClass,
131
- enumerable: false,
132
- writable: true,
133
- configurable: true
134
- }
135
- });
136
-
137
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass);
138
- }
139
-
140
- function taggedTemplateLiteralLoose(strings, raw) {
141
- strings.raw = raw;
142
- return strings;
143
- }
144
-
145
- function defineProperties(target, props) {
146
- for (var i = 0; i < props.length; i++) {
147
- var descriptor = props[i];
148
- descriptor.enumerable = descriptor.enumerable || false;
149
- descriptor.configurable = true;
150
- if ('value' in descriptor) descriptor.writable = true;
151
- Object.defineProperty(target, descriptor.key, descriptor);
152
- }
153
- }
154
-
155
- function createClass(Constructor, protoProps, staticProps) {
156
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
157
- if (staticProps) defineProperties(Constructor, staticProps);
158
- return Constructor;
159
- }
160
-
161
- function interopExportWildcard(obj, defaults) {
162
- var newObj = defaults({}, obj);
163
- delete newObj['default'];
164
- return newObj;
165
- }
166
-
167
- function defaults(obj, defaults) {
168
- var keys = Object.getOwnPropertyNames(defaults);
169
- for (var i = 0; i < keys.length; i++) {
170
- var key = keys[i];
171
- var value = Object.getOwnPropertyDescriptor(defaults, key);
172
- if (value && value.configurable && obj[key] === undefined) {
173
- Object.defineProperty(obj, key, value);
174
- }
175
- }
176
- return obj;
177
- }
178
-
179
- babelHelpers = {
180
- classCallCheck: classCallCheck,
181
- inherits: inherits,
182
- taggedTemplateLiteralLoose: taggedTemplateLiteralLoose,
183
- slice: Array.prototype.slice,
184
- createClass: createClass,
185
- interopExportWildcard: interopExportWildcard,
186
- defaults: defaults
187
- };
188
-
189
- enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) {
115
+ enifed('ember-debug/deprecate', ['exports', 'ember-metal/error', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetalError, _emberConsole, _emberEnvironment, _emberDebugHandlers) {
190
116
  /*global __fail__*/
191
117
 
192
118
  'use strict';
193
119
 
120
+ var _slice = Array.prototype.slice;
194
121
  exports.registerHandler = registerHandler;
195
122
  exports.default = deprecate;
196
123
 
@@ -265,7 +192,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'emb
265
192
  if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) {
266
193
  var updatedMessage = formatMessage(message);
267
194
 
268
- throw new _emberMetal.Error(updatedMessage);
195
+ throw new _emberMetalError.default(updatedMessage);
269
196
  } else {
270
197
  next.apply(undefined, arguments);
271
198
  }
@@ -331,7 +258,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'emb
331
258
  });
332
259
  }
333
260
 
334
- _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments)));
261
+ _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(_slice.call(arguments)));
335
262
  }
336
263
  });
337
264
  enifed("ember-debug/handlers", ["exports"], function (exports) {
@@ -367,7 +294,7 @@ enifed("ember-debug/handlers", ["exports"], function (exports) {
367
294
  }
368
295
  }
369
296
  });
370
- enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) {
297
+ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment', 'ember-metal/testing', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/error', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetalCore, _emberEnvironment, _emberMetalTesting, _emberMetalDebug, _emberMetalFeatures, _emberMetalError, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) {
371
298
  'use strict';
372
299
 
373
300
  exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
@@ -403,9 +330,9 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
403
330
  falsy, an exception will be thrown.
404
331
  @public
405
332
  */
406
- _emberMetal.setDebugFunction('assert', function assert(desc, test) {
333
+ _emberMetalDebug.setDebugFunction('assert', function assert(desc, test) {
407
334
  if (!test) {
408
- throw new _emberMetal.Error('Assertion Failed: ' + desc);
335
+ throw new _emberMetalError.default('Assertion Failed: ' + desc);
409
336
  }
410
337
  });
411
338
 
@@ -423,7 +350,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
423
350
  @param {String} message A debug message to display.
424
351
  @public
425
352
  */
426
- _emberMetal.setDebugFunction('debug', function debug(message) {
353
+ _emberMetalDebug.setDebugFunction('debug', function debug(message) {
427
354
  _emberConsole.default.debug('DEBUG: ' + message);
428
355
  });
429
356
 
@@ -436,7 +363,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
436
363
  @method info
437
364
  @private
438
365
  */
439
- _emberMetal.setDebugFunction('info', function info() {
366
+ _emberMetalDebug.setDebugFunction('info', function info() {
440
367
  _emberConsole.default.info.apply(undefined, arguments);
441
368
  });
442
369
 
@@ -459,7 +386,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
459
386
  @return {Function} A new function that wraps the original function with a deprecation warning
460
387
  @private
461
388
  */
462
- _emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() {
389
+ _emberMetalDebug.setDebugFunction('deprecateFunc', function deprecateFunc() {
463
390
  for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
464
391
  args[_key] = arguments[_key];
465
392
  }
@@ -472,7 +399,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
472
399
 
473
400
  return {
474
401
  v: function () {
475
- _emberMetal.deprecate(message, false, options);
402
+ _emberMetalDebug.deprecate(message, false, options);
476
403
  return func.apply(this, arguments);
477
404
  }
478
405
  };
@@ -486,7 +413,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
486
413
 
487
414
  return {
488
415
  v: function () {
489
- _emberMetal.deprecate(message);
416
+ _emberMetalDebug.deprecate(message);
490
417
  return func.apply(this, arguments);
491
418
  }
492
419
  };
@@ -517,21 +444,17 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
517
444
  @since 1.5.0
518
445
  @public
519
446
  */
520
- _emberMetal.setDebugFunction('runInDebug', function runInDebug(func) {
447
+ _emberMetalDebug.setDebugFunction('runInDebug', function runInDebug(func) {
521
448
  func();
522
449
  });
523
450
 
524
- _emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) {
451
+ _emberMetalDebug.setDebugFunction('debugSeal', function debugSeal(obj) {
525
452
  Object.seal(obj);
526
453
  });
527
454
 
528
- _emberMetal.setDebugFunction('debugFreeze', function debugFreeze(obj) {
529
- Object.freeze(obj);
530
- });
531
-
532
- _emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default);
455
+ _emberMetalDebug.setDebugFunction('deprecate', _emberDebugDeprecate.default);
533
456
 
534
- _emberMetal.setDebugFunction('warn', _emberDebugWarn.default);
457
+ _emberMetalDebug.setDebugFunction('warn', _emberDebugWarn.default);
535
458
 
536
459
  /**
537
460
  Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or
@@ -546,7 +469,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
546
469
 
547
470
  function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
548
471
  if (featuresWereStripped) {
549
- _emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
472
+ _emberMetalDebug.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
550
473
 
551
474
  var keys = Object.keys(FEATURES || {});
552
475
  for (var i = 0; i < keys.length; i++) {
@@ -555,23 +478,23 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
555
478
  continue;
556
479
  }
557
480
 
558
- _emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
481
+ _emberMetalDebug.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
559
482
  }
560
483
  }
561
484
  }
562
485
 
563
- if (!_emberMetal.isTesting()) {
486
+ if (!_emberMetalTesting.isTesting()) {
564
487
  (function () {
565
488
  // Complain if they're using FEATURE flags in builds other than canary
566
- _emberMetal.FEATURES['features-stripped-test'] = true;
489
+ _emberMetalFeatures.FEATURES['features-stripped-test'] = true;
567
490
  var featuresWereStripped = true;
568
491
 
569
492
  if (false) {
570
493
  featuresWereStripped = false;
571
494
  }
572
495
 
573
- delete _emberMetal.FEATURES['features-stripped-test'];
574
- _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped);
496
+ delete _emberMetalFeatures.FEATURES['features-stripped-test'];
497
+ _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetalFeatures.DEFAULT_FEATURES, featuresWereStripped);
575
498
 
576
499
  // Inform the developer about the Ember Inspector if not installed.
577
500
  var isFirefox = _emberEnvironment.environment.isFirefox;
@@ -588,7 +511,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
588
511
  downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
589
512
  }
590
513
 
591
- _emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
514
+ _emberMetalDebug.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
592
515
  }
593
516
  }, false);
594
517
  }
@@ -598,7 +521,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
598
521
  @public
599
522
  @class Ember.Debug
600
523
  */
601
- _emberMetal.default.Debug = {};
524
+ _emberMetalCore.default.Debug = {};
602
525
 
603
526
  /**
604
527
  Allows for runtime registration of handler functions that override the default deprecation behavior.
@@ -614,7 +537,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
614
537
  // defer to whatever handler was registered before this one
615
538
  next(message, options);
616
539
  }
617
- });
540
+ }
618
541
  ```
619
542
 
620
543
  The handler function takes the following arguments:
@@ -635,7 +558,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
635
558
  @param handler {Function} A function to handle deprecation calls.
636
559
  @since 2.1.0
637
560
  */
638
- _emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler;
561
+ _emberMetalCore.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler;
639
562
  /**
640
563
  Allows for runtime registration of handler functions that override the default warning behavior.
641
564
  Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
@@ -664,7 +587,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
664
587
  @param handler {Function} A function to handle warnings.
665
588
  @since 2.1.0
666
589
  */
667
- _emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler;
590
+ _emberMetalCore.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler;
668
591
 
669
592
  /*
670
593
  We are transitioning away from `ember.js` to `ember.debug.js` to make
@@ -677,13 +600,14 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb
677
600
  var runningNonEmberDebugJS = false;
678
601
  exports.runningNonEmberDebugJS = runningNonEmberDebugJS;
679
602
  if (runningNonEmberDebugJS) {
680
- _emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
603
+ _emberMetalDebug.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
681
604
  }
682
605
  });
683
606
  // reexports
684
- enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) {
607
+ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal/debug', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetalDebug, _emberDebugHandlers) {
685
608
  'use strict';
686
609
 
610
+ var _slice = Array.prototype.slice;
687
611
  exports.registerHandler = registerHandler;
688
612
  exports.default = warn;
689
613
 
@@ -728,7 +652,7 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-de
728
652
 
729
653
  function warn(message, test, options) {
730
654
  if (!options) {
731
- _emberMetal.deprecate(missingOptionsDeprecation, false, {
655
+ _emberMetalDebug.deprecate(missingOptionsDeprecation, false, {
732
656
  id: 'ember-debug.warn-options-missing',
733
657
  until: '3.0.0',
734
658
  url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
@@ -736,17 +660,17 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-de
736
660
  }
737
661
 
738
662
  if (options && !options.id) {
739
- _emberMetal.deprecate(missingOptionsIdDeprecation, false, {
663
+ _emberMetalDebug.deprecate(missingOptionsIdDeprecation, false, {
740
664
  id: 'ember-debug.warn-id-missing',
741
665
  until: '3.0.0',
742
666
  url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
743
667
  });
744
668
  }
745
669
 
746
- _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments)));
670
+ _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(_slice.call(arguments)));
747
671
  }
748
672
  });
749
- enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
673
+ enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) {
750
674
  'use strict';
751
675
 
752
676
  function K() {
@@ -766,7 +690,7 @@ enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function
766
690
  @namespace Ember.Test
767
691
  @public
768
692
  */
769
- exports.default = _emberRuntime.Object.extend({
693
+ exports.default = _emberRuntimeSystemObject.default.extend({
770
694
  /**
771
695
  This callback will be called whenever an async operation is about to start.
772
696
  Override this to call your framework's methods that handle async
@@ -802,7 +726,7 @@ enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function
802
726
  }
803
727
  });
804
728
  });
805
- enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils, _emberTestingAdaptersAdapter) {
729
+ enifed('ember-testing/adapters/qunit', ['exports', 'ember-testing/adapters/adapter', 'ember-metal/utils'], function (exports, _emberTestingAdaptersAdapter, _emberMetalUtils) {
806
730
  'use strict';
807
731
 
808
732
  /**
@@ -822,11 +746,11 @@ enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing
822
746
  QUnit.start();
823
747
  },
824
748
  exception: function (error) {
825
- ok(false, _emberUtils.inspect(error));
749
+ ok(false, _emberMetalUtils.inspect(error));
826
750
  }
827
751
  });
828
752
  });
829
- enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], function (exports, _emberViews, _emberMetal) {
753
+ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-metal/run_loop'], function (exports, _emberViewsSystemJquery, _emberMetalRun_loop) {
830
754
  'use strict';
831
755
 
832
756
  exports.focus = focus;
@@ -840,11 +764,11 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
840
764
  if (!el) {
841
765
  return;
842
766
  }
843
- var $el = _emberViews.jQuery(el);
767
+ var $el = _emberViewsSystemJquery.default(el);
844
768
  if ($el.is(':input, [contenteditable=true]')) {
845
769
  var type = $el.prop('type');
846
770
  if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {
847
- _emberMetal.run(null, function () {
771
+ _emberMetalRun_loop.default(null, function () {
848
772
  // Firefox does not trigger the `focusin` event if the window
849
773
  // does not have focus. If the document doesn't have focus just
850
774
  // use trigger('focusin') instead.
@@ -878,7 +802,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
878
802
  clientX: x,
879
803
  clientY: y
880
804
  };
881
- event = buildMouseEvent(type, _emberViews.jQuery.extend(simulatedCoordinates, options));
805
+ event = buildMouseEvent(type, _emberViewsSystemJquery.default.extend(simulatedCoordinates, options));
882
806
  } else {
883
807
  event = buildBasicEvent(type, options);
884
808
  }
@@ -890,7 +814,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
890
814
 
891
815
  var event = document.createEvent('Events');
892
816
  event.initEvent(type, true, true);
893
- _emberViews.jQuery.extend(event, options);
817
+ _emberViewsSystemJquery.default.extend(event, options);
894
818
  return event;
895
819
  }
896
820
 
@@ -900,7 +824,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
900
824
  var event = undefined;
901
825
  try {
902
826
  event = document.createEvent('MouseEvents');
903
- var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options);
827
+ var eventOpts = _emberViewsSystemJquery.default.extend({}, DEFAULT_EVENT_OPTIONS, options);
904
828
  event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget);
905
829
  } catch (e) {
906
830
  event = buildBasicEvent(type, options);
@@ -914,7 +838,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
914
838
  var event = undefined;
915
839
  try {
916
840
  event = document.createEvent('KeyEvents');
917
- var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options);
841
+ var eventOpts = _emberViewsSystemJquery.default.extend({}, DEFAULT_EVENT_OPTIONS, options);
918
842
  event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode);
919
843
  } catch (e) {
920
844
  event = buildBasicEvent(type, options);
@@ -922,10 +846,10 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
922
846
  return event;
923
847
  }
924
848
  });
925
- enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) {
849
+ enifed('ember-testing/ext/application', ['exports', 'ember-application/system/application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplicationSystemApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) {
926
850
  'use strict';
927
851
 
928
- _emberApplication.Application.reopen({
852
+ _emberApplicationSystemApplication.default.reopen({
929
853
  /**
930
854
  This property contains the testing helpers for the current application. These
931
855
  are created once you call `injectTestHelpers` on your `Ember.Application`
@@ -1112,69 +1036,53 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
1112
1036
  };
1113
1037
  }
1114
1038
  });
1115
- enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberTestingTestAdapter) {
1039
+ enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime/ext/rsvp', 'ember-metal/run_loop', 'ember-metal/testing', 'ember-testing/test/adapter'], function (exports, _emberRuntimeExtRsvp, _emberMetalRun_loop, _emberMetalTesting, _emberTestingTestAdapter) {
1116
1040
  'use strict';
1117
1041
 
1118
- _emberRuntime.RSVP.configure('async', function (callback, promise) {
1042
+ _emberRuntimeExtRsvp.default.configure('async', function (callback, promise) {
1119
1043
  // if schedule will cause autorun, we need to inform adapter
1120
- if (_emberMetal.isTesting() && !_emberMetal.run.backburner.currentInstance) {
1044
+ if (_emberMetalTesting.isTesting() && !_emberMetalRun_loop.default.backburner.currentInstance) {
1121
1045
  _emberTestingTestAdapter.asyncStart();
1122
- _emberMetal.run.backburner.schedule('actions', function () {
1046
+ _emberMetalRun_loop.default.backburner.schedule('actions', function () {
1123
1047
  _emberTestingTestAdapter.asyncEnd();
1124
1048
  callback(promise);
1125
1049
  });
1126
1050
  } else {
1127
- _emberMetal.run.backburner.schedule('actions', function () {
1051
+ _emberMetalRun_loop.default.backburner.schedule('actions', function () {
1128
1052
  return callback(promise);
1129
1053
  });
1130
1054
  }
1131
1055
  });
1132
1056
 
1133
- exports.default = _emberRuntime.RSVP;
1057
+ exports.default = _emberRuntimeExtRsvp.default;
1134
1058
  });
1135
- enifed('ember-testing/helpers', ['exports', 'ember-metal', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberMetal, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) {
1059
+ enifed('ember-testing/helpers', ['exports', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) {
1136
1060
  'use strict';
1137
1061
 
1138
- _emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default);
1139
- _emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default);
1140
- _emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default);
1141
- _emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default);
1142
- _emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default);
1143
- _emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default);
1144
- _emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.pauseTest);
1145
- _emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default);
1146
-
1147
- _emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default);
1148
- _emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default);
1149
- _emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default);
1150
- _emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default);
1151
- _emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default);
1152
-
1153
- if (false) {
1154
- _emberTestingTestHelpers.registerHelper('resumeTest', _emberTestingHelpersPause_test.resumeTest);
1155
- }
1156
- });
1157
- enifed("ember-testing/helpers/and_then", ["exports"], function (exports) {
1158
1062
  /**
1159
1063
  @module ember
1160
1064
  @submodule ember-testing
1161
1065
  */
1162
- "use strict";
1163
1066
 
1164
- exports.default = andThen;
1165
-
1166
- function andThen(app, callback) {
1167
- return app.testHelpers.wait(callback(app));
1168
- }
1169
- });
1170
- enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
1171
1067
  /**
1172
- @module ember
1173
- @submodule ember-testing
1068
+ Loads a route, sets up any controllers, and renders any templates associated
1069
+ with the route as though a real user had triggered the route change while
1070
+ using your app.
1071
+
1072
+ Example:
1073
+
1074
+ ```javascript
1075
+ visit('posts/index').then(function() {
1076
+ // assert something
1077
+ });
1078
+ ```
1079
+
1080
+ @method visit
1081
+ @param {String} url the name of the route
1082
+ @return {RSVP.Promise}
1083
+ @public
1174
1084
  */
1175
- 'use strict';
1176
-
1177
- exports.default = click;
1085
+ _emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default);
1178
1086
 
1179
1087
  /**
1180
1088
  Clicks an element and triggers any actions triggered by the element's `click`
@@ -1194,30 +1102,111 @@ enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], funct
1194
1102
  @return {RSVP.Promise}
1195
1103
  @public
1196
1104
  */
1105
+ _emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default);
1197
1106
 
1198
- function click(app, selector, context) {
1199
- var $el = app.testHelpers.findWithAssert(selector, context);
1200
- var el = $el[0];
1201
-
1202
- _emberTestingEvents.fireEvent(el, 'mousedown');
1203
-
1204
- _emberTestingEvents.focus(el);
1107
+ /**
1108
+ Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
1109
+
1110
+ Example:
1111
+
1112
+ ```javascript
1113
+ keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
1114
+ // assert something
1115
+ });
1116
+ ```
1117
+
1118
+ @method keyEvent
1119
+ @param {String} selector jQuery selector for finding element on the DOM
1120
+ @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`
1121
+ @param {Number} keyCode the keyCode of the simulated key event
1122
+ @return {RSVP.Promise}
1123
+ @since 1.5.0
1124
+ @public
1125
+ */
1126
+ _emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default);
1205
1127
 
1206
- _emberTestingEvents.fireEvent(el, 'mouseup');
1207
- _emberTestingEvents.fireEvent(el, 'click');
1128
+ /**
1129
+ Fills in an input element with some text.
1130
+
1131
+ Example:
1132
+
1133
+ ```javascript
1134
+ fillIn('#email', 'you@example.com').then(function() {
1135
+ // assert something
1136
+ });
1137
+ ```
1138
+
1139
+ @method fillIn
1140
+ @param {String} selector jQuery selector finding an input element on the DOM
1141
+ to fill text with
1142
+ @param {String} text text to place inside the input element
1143
+ @return {RSVP.Promise}
1144
+ @public
1145
+ */
1146
+ _emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default);
1208
1147
 
1209
- return app.testHelpers.wait();
1210
- }
1211
- });
1212
- enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) {
1213
1148
  /**
1214
- @module ember
1215
- @submodule ember-testing
1149
+ Finds an element in the context of the app's container element. A simple alias
1150
+ for `app.$(selector)`.
1151
+
1152
+ Example:
1153
+
1154
+ ```javascript
1155
+ var $el = find('.my-selector');
1156
+ ```
1157
+
1158
+ @method find
1159
+ @param {String} selector jQuery string selector for element lookup
1160
+ @return {Object} jQuery object representing the results of the query
1161
+ @public
1216
1162
  */
1217
- 'use strict';
1163
+ _emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default);
1218
1164
 
1219
- exports.default = currentPath;
1165
+ /**
1166
+ Like `find`, but throws an error if the element selector returns no results.
1167
+
1168
+ Example:
1169
+
1170
+ ```javascript
1171
+ var $el = findWithAssert('.doesnt-exist'); // throws error
1172
+ ```
1173
+
1174
+ @method findWithAssert
1175
+ @param {String} selector jQuery selector string for finding an element within
1176
+ the DOM
1177
+ @return {Object} jQuery object representing the results of the query
1178
+ @throws {Error} throws error if jQuery object returned has a length of 0
1179
+ @public
1180
+ */
1181
+ _emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default);
1220
1182
 
1183
+ /**
1184
+ Causes the run loop to process any pending events. This is used to ensure that
1185
+ any async operations from other helpers (or your assertions) have been processed.
1186
+
1187
+ This is most often used as the return value for the helper functions (see 'click',
1188
+ 'fillIn','visit',etc).
1189
+
1190
+ Example:
1191
+
1192
+ ```javascript
1193
+ Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {
1194
+ visit('secured/path/here')
1195
+ .fillIn('#username', username)
1196
+ .fillIn('#password', password)
1197
+ .click('.submit')
1198
+
1199
+ return app.testHelpers.wait();
1200
+ });
1201
+
1202
+ @method wait
1203
+ @param {Object} value The value to be returned.
1204
+ @return {RSVP.Promise}
1205
+ @public
1206
+ */
1207
+ _emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default);
1208
+ _emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default);
1209
+ _emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default);
1221
1210
  /**
1222
1211
  Returns the current path.
1223
1212
 
@@ -1236,13 +1225,69 @@ enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], functio
1236
1225
  @since 1.5.0
1237
1226
  @public
1238
1227
  */
1228
+ _emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default);
1229
+
1230
+ /**
1231
+ Returns the current URL.
1232
+
1233
+ Example:
1234
+
1235
+ ```javascript
1236
+ function validateURL() {
1237
+ equal(currentURL(), '/some/path', "correct URL was transitioned into.");
1238
+ }
1239
+
1240
+ click('#some-link-id').then(validateURL);
1241
+ ```
1242
+
1243
+ @method currentURL
1244
+ @return {Object} The currently active URL.
1245
+ @since 1.5.0
1246
+ @public
1247
+ */
1248
+ _emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default);
1249
+ _emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.default);
1250
+ _emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default);
1251
+ });
1252
+ enifed("ember-testing/helpers/and_then", ["exports"], function (exports) {
1253
+ "use strict";
1254
+
1255
+ exports.default = andThen;
1256
+
1257
+ function andThen(app, callback) {
1258
+ return app.testHelpers.wait(callback(app));
1259
+ }
1260
+ });
1261
+ enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
1262
+ 'use strict';
1263
+
1264
+ exports.default = click;
1265
+
1266
+ function click(app, selector, context) {
1267
+ var $el = app.testHelpers.findWithAssert(selector, context);
1268
+ var el = $el[0];
1269
+
1270
+ _emberTestingEvents.fireEvent(el, 'mousedown');
1271
+
1272
+ _emberTestingEvents.focus(el);
1273
+
1274
+ _emberTestingEvents.fireEvent(el, 'mouseup');
1275
+ _emberTestingEvents.fireEvent(el, 'click');
1276
+
1277
+ return app.testHelpers.wait();
1278
+ }
1279
+ });
1280
+ enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) {
1281
+ 'use strict';
1282
+
1283
+ exports.default = currentPath;
1239
1284
 
1240
1285
  function currentPath(app) {
1241
1286
  var routingService = app.__container__.lookup('service:-routing');
1242
- return _emberMetal.get(routingService, 'currentPath');
1287
+ return _emberMetalProperty_get.get(routingService, 'currentPath');
1243
1288
  }
1244
1289
  });
1245
- enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) {
1290
+ enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) {
1246
1291
  /**
1247
1292
  @module ember
1248
1293
  @submodule ember-testing
@@ -1268,70 +1313,24 @@ enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], f
1268
1313
 
1269
1314
  function currentRouteName(app) {
1270
1315
  var routingService = app.__container__.lookup('service:-routing');
1271
- return _emberMetal.get(routingService, 'currentRouteName');
1316
+ return _emberMetalProperty_get.get(routingService, 'currentRouteName');
1272
1317
  }
1273
1318
  });
1274
- enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) {
1275
- /**
1276
- @module ember
1277
- @submodule ember-testing
1278
- */
1319
+ enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) {
1279
1320
  'use strict';
1280
1321
 
1281
1322
  exports.default = currentURL;
1282
1323
 
1283
- /**
1284
- Returns the current URL.
1285
-
1286
- Example:
1287
-
1288
- ```javascript
1289
- function validateURL() {
1290
- equal(currentURL(), '/some/path', "correct URL was transitioned into.");
1291
- }
1292
-
1293
- click('#some-link-id').then(validateURL);
1294
- ```
1295
-
1296
- @method currentURL
1297
- @return {Object} The currently active URL.
1298
- @since 1.5.0
1299
- @public
1300
- */
1301
-
1302
1324
  function currentURL(app) {
1303
1325
  var router = app.__container__.lookup('router:main');
1304
- return _emberMetal.get(router, 'location').getURL();
1326
+ return _emberMetalProperty_get.get(router, 'location').getURL();
1305
1327
  }
1306
1328
  });
1307
1329
  enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
1308
- /**
1309
- @module ember
1310
- @submodule ember-testing
1311
- */
1312
1330
  'use strict';
1313
1331
 
1314
1332
  exports.default = fillIn;
1315
1333
 
1316
- /**
1317
- Fills in an input element with some text.
1318
-
1319
- Example:
1320
-
1321
- ```javascript
1322
- fillIn('#email', 'you@example.com').then(function() {
1323
- // assert something
1324
- });
1325
- ```
1326
-
1327
- @method fillIn
1328
- @param {String} selector jQuery selector finding an input element on the DOM
1329
- to fill text with
1330
- @param {String} text text to place inside the input element
1331
- @return {RSVP.Promise}
1332
- @public
1333
- */
1334
-
1335
1334
  function fillIn(app, selector, contextOrText, text) {
1336
1335
  var $el = undefined,
1337
1336
  el = undefined,
@@ -1352,75 +1351,19 @@ enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], fun
1352
1351
  return app.testHelpers.wait();
1353
1352
  }
1354
1353
  });
1355
- enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) {
1356
- /**
1357
- @module ember
1358
- @submodule ember-testing
1359
- */
1354
+ enifed('ember-testing/helpers/find', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) {
1360
1355
  'use strict';
1361
1356
 
1362
1357
  exports.default = find;
1363
1358
 
1364
- /**
1365
- Finds an element in the context of the app's container element. A simple alias
1366
- for `app.$(selector)`.
1367
-
1368
- Example:
1369
-
1370
- ```javascript
1371
- var $el = find('.my-selector');
1372
- ```
1373
-
1374
- With the `context` param:
1375
-
1376
- ```javascript
1377
- var $el = find('.my-selector', '.parent-element-class');
1378
- ```
1379
-
1380
- @method find
1381
- @param {String} selector jQuery string selector for element lookup
1382
- @param {String} [context] (optional) jQuery selector that will limit the selector
1383
- argument to find only within the context's children
1384
- @return {Object} jQuery object representing the results of the query
1385
- @public
1386
- */
1387
-
1388
1359
  function find(app, selector, context) {
1389
1360
  var $el = undefined;
1390
- context = context || _emberMetal.get(app, 'rootElement');
1361
+ context = context || _emberMetalProperty_get.get(app, 'rootElement');
1391
1362
  $el = app.$(selector, context);
1392
1363
  return $el;
1393
1364
  }
1394
1365
  });
1395
1366
  enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) {
1396
- /**
1397
- @module ember
1398
- @submodule ember-testing
1399
- */
1400
- /**
1401
- Like `find`, but throws an error if the element selector returns no results.
1402
-
1403
- Example:
1404
-
1405
- ```javascript
1406
- var $el = findWithAssert('.doesnt-exist'); // throws error
1407
- ```
1408
-
1409
- With the `context` param:
1410
-
1411
- ```javascript
1412
- var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass
1413
- ```
1414
-
1415
- @method findWithAssert
1416
- @param {String} selector jQuery selector string for finding an element within
1417
- the DOM
1418
- @param {String} [context] (optional) jQuery selector that will limit the
1419
- selector argument to find only within the context's children
1420
- @return {Object} jQuery object representing the results of the query
1421
- @throws {Error} throws error if jQuery object returned has a length of 0
1422
- @public
1423
- */
1424
1367
  'use strict';
1425
1368
 
1426
1369
  exports.default = findWithAssert;
@@ -1434,26 +1377,6 @@ enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports)
1434
1377
  }
1435
1378
  });
1436
1379
  enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
1437
- /**
1438
- @module ember
1439
- @submodule ember-testing
1440
- */
1441
- /**
1442
- Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
1443
- Example:
1444
- ```javascript
1445
- keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
1446
- // assert something
1447
- });
1448
- ```
1449
- @method keyEvent
1450
- @param {String} selector jQuery selector for finding element on the DOM
1451
- @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`
1452
- @param {Number} keyCode the keyCode of the simulated key event
1453
- @return {RSVP.Promise}
1454
- @since 1.5.0
1455
- @public
1456
- */
1457
1380
  'use strict';
1458
1381
 
1459
1382
  exports.default = keyEvent;
@@ -1474,37 +1397,19 @@ enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
1474
1397
  return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode });
1475
1398
  }
1476
1399
  });
1477
- enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-console', 'ember-metal'], function (exports, _emberRuntime, _emberConsole, _emberMetal) {
1400
+ enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime/ext/rsvp'], function (exports, _emberRuntimeExtRsvp) {
1478
1401
  /**
1479
1402
  @module ember
1480
1403
  @submodule ember-testing
1481
1404
  */
1482
1405
  'use strict';
1483
1406
 
1484
- exports.resumeTest = resumeTest;
1485
- exports.pauseTest = pauseTest;
1486
-
1487
- var resume = undefined;
1488
-
1489
- /**
1490
- Resumes a test paused by `pauseTest`.
1491
-
1492
- @method resumeTest
1493
- @return {void}
1494
- @public
1495
- */
1496
-
1497
- function resumeTest() {
1498
- _emberMetal.assert('Testing has not been paused. There is nothing to resume.', resume);
1499
- resume();
1500
- resume = undefined;
1501
- }
1407
+ exports.default = pauseTest;
1502
1408
 
1503
1409
  /**
1504
1410
  Pauses the current test - this is useful for debugging while testing or for test-driving.
1505
1411
  It allows you to inspect the state of your application at any point.
1506
1412
  Example (The test will pause before clicking the button):
1507
-
1508
1413
  ```javascript
1509
1414
  visit('/')
1510
1415
  return pauseTest();
@@ -1517,15 +1422,7 @@ enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-c
1517
1422
  */
1518
1423
 
1519
1424
  function pauseTest() {
1520
- if (false) {
1521
- _emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.');
1522
- }
1523
-
1524
- return new _emberRuntime.RSVP.Promise(function (resolve) {
1525
- if (false) {
1526
- resume = resolve;
1527
- }
1528
- }, 'TestAdapter paused promise');
1425
+ return new _emberRuntimeExtRsvp.default.Promise(function () {}, 'TestAdapter paused promise');
1529
1426
  }
1530
1427
  });
1531
1428
  enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
@@ -1599,34 +1496,11 @@ enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'
1599
1496
  return app.testHelpers.wait();
1600
1497
  }
1601
1498
  });
1602
- enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) {
1603
- /**
1604
- @module ember
1605
- @submodule ember-testing
1606
- */
1499
+ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) {
1607
1500
  'use strict';
1608
1501
 
1609
1502
  exports.default = visit;
1610
1503
 
1611
- /**
1612
- Loads a route, sets up any controllers, and renders any templates associated
1613
- with the route as though a real user had triggered the route change while
1614
- using your app.
1615
-
1616
- Example:
1617
-
1618
- ```javascript
1619
- visit('posts/index').then(function() {
1620
- // assert something
1621
- });
1622
- ```
1623
-
1624
- @method visit
1625
- @param {String} url the name of the route
1626
- @return {RSVP.Promise}
1627
- @public
1628
- */
1629
-
1630
1504
  function visit(app, url) {
1631
1505
  var router = app.__container__.lookup('router:main');
1632
1506
  var shouldHandleURL = false;
@@ -1635,13 +1509,13 @@ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (expo
1635
1509
  router.location.setURL(url);
1636
1510
 
1637
1511
  if (shouldHandleURL) {
1638
- _emberMetal.run(app.__deprecatedInstance__, 'handleURL', url);
1512
+ _emberMetalRun_loop.default(app.__deprecatedInstance__, 'handleURL', url);
1639
1513
  }
1640
1514
  });
1641
1515
 
1642
1516
  if (app._readinessDeferrals > 0) {
1643
1517
  router['initialURL'] = url;
1644
- _emberMetal.run(app, 'advanceReadiness');
1518
+ _emberMetalRun_loop.default(app, 'advanceReadiness');
1645
1519
  delete router['initialURL'];
1646
1520
  } else {
1647
1521
  shouldHandleURL = true;
@@ -1650,42 +1524,13 @@ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (expo
1650
1524
  return app.testHelpers.wait();
1651
1525
  }
1652
1526
  });
1653
- enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntime, _emberMetal, _emberTestingTestPending_requests) {
1654
- /**
1655
- @module ember
1656
- @submodule ember-testing
1657
- */
1527
+ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime/ext/rsvp', 'ember-metal/run_loop', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntimeExtRsvp, _emberMetalRun_loop, _emberTestingTestPending_requests) {
1658
1528
  'use strict';
1659
1529
 
1660
1530
  exports.default = wait;
1661
1531
 
1662
- /**
1663
- Causes the run loop to process any pending events. This is used to ensure that
1664
- any async operations from other helpers (or your assertions) have been processed.
1665
-
1666
- This is most often used as the return value for the helper functions (see 'click',
1667
- 'fillIn','visit',etc).
1668
-
1669
- Example:
1670
-
1671
- ```javascript
1672
- Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {
1673
- visit('secured/path/here')
1674
- .fillIn('#username', username)
1675
- .fillIn('#password', password)
1676
- .click('.submit')
1677
-
1678
- return app.testHelpers.wait();
1679
- });
1680
-
1681
- @method wait
1682
- @param {Object} value The value to be returned.
1683
- @return {RSVP.Promise}
1684
- @public
1685
- */
1686
-
1687
1532
  function wait(app, value) {
1688
- return new _emberRuntime.RSVP.Promise(function (resolve) {
1533
+ return new _emberRuntimeExtRsvp.default.Promise(function (resolve) {
1689
1534
  var router = app.__container__.lookup('router:main');
1690
1535
 
1691
1536
  // Every 10ms, poll for the async thing to have finished
@@ -1702,7 +1547,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
1702
1547
  }
1703
1548
 
1704
1549
  // 3. If there are scheduled timers or we are inside of a run loop, keep polling
1705
- if (_emberMetal.run.hasScheduledTimers() || _emberMetal.run.currentRunLoop) {
1550
+ if (_emberMetalRun_loop.default.hasScheduledTimers() || _emberMetalRun_loop.default.currentRunLoop) {
1706
1551
  return;
1707
1552
  }
1708
1553
 
@@ -1714,34 +1559,39 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
1714
1559
  clearInterval(watcher);
1715
1560
 
1716
1561
  // Synchronously resolve the promise
1717
- _emberMetal.run(null, resolve, value);
1562
+ _emberMetalRun_loop.default(null, resolve, value);
1718
1563
  }, 10);
1719
1564
  });
1720
1565
  }
1721
1566
  });
1722
- enifed('ember-testing/index', ['exports', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit'], function (exports, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _emberTestingAdaptersQunit) {
1567
+ enifed('ember-testing/index', ['exports', 'ember-metal/core', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'require', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers'], function (exports, _emberMetalCore, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _require, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers) {
1723
1568
  'use strict';
1724
1569
 
1725
- exports.Test = _emberTestingTest.default;
1726
- exports.Adapter = _emberTestingAdaptersAdapter.default;
1727
- exports.setupForTesting = _emberTestingSetup_for_testing.default;
1728
- exports.QUnitAdapter = _emberTestingAdaptersQunit.default;
1570
+ // to setup initializer
1571
+
1572
+ /**
1573
+ @module ember
1574
+ @submodule ember-testing
1575
+ */
1576
+
1577
+ _emberMetalCore.default.Test = _emberTestingTest.default;
1578
+ _emberMetalCore.default.Test.Adapter = _emberTestingAdaptersAdapter.default;
1579
+ _emberMetalCore.default.setupForTesting = _emberTestingSetup_for_testing.default;
1580
+ Object.defineProperty(_emberTestingTest.default, 'QUnitAdapter', {
1581
+ get: function () {
1582
+ return _require.default('ember-testing/adapters/qunit').default;
1583
+ }
1584
+ });
1729
1585
  });
1586
+ // reexports
1730
1587
  // to handle various edge cases
1731
- // setup RSVP + run loop integration
1732
1588
  // adds helpers to helpers object in Test
1733
- // to setup initializer
1734
-
1735
- /**
1736
- @module ember
1737
- @submodule ember-testing
1738
- */
1739
- enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
1589
+ enifed('ember-testing/initializers', ['exports', 'ember-runtime/system/lazy_load'], function (exports, _emberRuntimeSystemLazy_load) {
1740
1590
  'use strict';
1741
1591
 
1742
1592
  var name = 'deferReadiness in `testing` mode';
1743
1593
 
1744
- _emberRuntime.onLoad('Ember.Application', function (Application) {
1594
+ _emberRuntimeSystemLazy_load.onLoad('Ember.Application', function (Application) {
1745
1595
  if (!Application.initializers[name]) {
1746
1596
  Application.initializer({
1747
1597
  name: name,
@@ -1755,7 +1605,7 @@ enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exp
1755
1605
  }
1756
1606
  });
1757
1607
  });
1758
- enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) {
1608
+ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal/testing', 'ember-views/system/jquery', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'require'], function (exports, _emberMetalTesting, _emberViewsSystemJquery, _emberTestingTestAdapter, _emberTestingTestPending_requests, _require) {
1759
1609
  'use strict';
1760
1610
 
1761
1611
  exports.default = setupForTesting;
@@ -1774,24 +1624,25 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-view
1774
1624
  */
1775
1625
 
1776
1626
  function setupForTesting() {
1777
- _emberMetal.setTesting(true);
1627
+ _emberMetalTesting.setTesting(true);
1778
1628
 
1779
1629
  var adapter = _emberTestingTestAdapter.getAdapter();
1780
1630
  // if adapter is not manually set default to QUnit
1781
1631
  if (!adapter) {
1782
- _emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default());
1632
+ var QUnitAdapter = _require.default('ember-testing/adapters/qunit').default;
1633
+ _emberTestingTestAdapter.setAdapter(new QUnitAdapter());
1783
1634
  }
1784
1635
 
1785
- _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests);
1786
- _emberViews.jQuery(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests);
1636
+ _emberViewsSystemJquery.default(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests);
1637
+ _emberViewsSystemJquery.default(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests);
1787
1638
 
1788
1639
  _emberTestingTestPending_requests.clearPendingRequests();
1789
1640
 
1790
- _emberViews.jQuery(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests);
1791
- _emberViews.jQuery(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests);
1641
+ _emberViewsSystemJquery.default(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests);
1642
+ _emberViewsSystemJquery.default(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests);
1792
1643
  }
1793
1644
  });
1794
- enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember-environment'], function (exports, _emberMetal, _emberViews, _emberEnvironment) {
1645
+ enifed('ember-testing/support', ['exports', 'ember-metal/debug', 'ember-views/system/jquery', 'ember-environment'], function (exports, _emberMetalDebug, _emberViewsSystemJquery, _emberEnvironment) {
1795
1646
  'use strict';
1796
1647
 
1797
1648
  /**
@@ -1799,7 +1650,7 @@ enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember
1799
1650
  @submodule ember-testing
1800
1651
  */
1801
1652
 
1802
- var $ = _emberViews.jQuery;
1653
+ var $ = _emberViewsSystemJquery.default;
1803
1654
 
1804
1655
  /**
1805
1656
  This method creates a checkbox and triggers the click event to fire the
@@ -1810,11 +1661,10 @@ enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember
1810
1661
  @method testCheckboxClick
1811
1662
  */
1812
1663
  function testCheckboxClick(handler) {
1813
- var input = document.createElement('input');
1814
- $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();
1664
+ $('<input type="checkbox">').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();
1815
1665
  }
1816
1666
 
1817
- if (_emberEnvironment.environment.hasDOM && typeof $ === 'function') {
1667
+ if (_emberEnvironment.environment.hasDOM) {
1818
1668
  $(function () {
1819
1669
  /*
1820
1670
  Determine whether a checkbox checked using jQuery's "click" method will have
@@ -1839,12 +1689,12 @@ enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember
1839
1689
 
1840
1690
  // Try again to verify that the patch took effect or blow up.
1841
1691
  testCheckboxClick(function () {
1842
- _emberMetal.warn('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked, { id: 'ember-testing.test-checkbox-click' });
1692
+ _emberMetalDebug.warn('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked, { id: 'ember-testing.test-checkbox-click' });
1843
1693
  });
1844
1694
  });
1845
1695
  }
1846
1696
  });
1847
- enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter, _emberMetal) {
1697
+ enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter', 'ember-metal/features'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter, _emberMetalFeatures) {
1848
1698
  /**
1849
1699
  @module ember
1850
1700
  @submodule ember-testing
@@ -1918,7 +1768,7 @@ enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-te
1918
1768
 
1919
1769
  exports.default = Test;
1920
1770
  });
1921
- enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) {
1771
+ enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal/error_handler'], function (exports, _emberConsole, _emberMetalError_handler) {
1922
1772
  'use strict';
1923
1773
 
1924
1774
  exports.getAdapter = getAdapter;
@@ -1935,9 +1785,9 @@ enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal']
1935
1785
  function setAdapter(value) {
1936
1786
  adapter = value;
1937
1787
  if (value) {
1938
- _emberMetal.setDispatchOverride(adapterDispatch);
1788
+ _emberMetalError_handler.setDispatchOverride(adapterDispatch);
1939
1789
  } else {
1940
- _emberMetal.setDispatchOverride(null);
1790
+ _emberMetalError_handler.setDispatchOverride(null);
1941
1791
  }
1942
1792
  }
1943
1793
 
@@ -2148,20 +1998,26 @@ enifed("ember-testing/test/pending_requests", ["exports"], function (exports) {
2148
1998
  }
2149
1999
  }
2150
2000
  });
2151
- enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime, _emberTestingTestRun) {
2001
+ enifed('ember-testing/test/promise', ['exports', 'ember-runtime/ext/rsvp', 'ember-testing/test/run'], function (exports, _emberRuntimeExtRsvp, _emberTestingTestRun) {
2152
2002
  'use strict';
2153
2003
 
2154
2004
  exports.promise = promise;
2155
2005
  exports.resolve = resolve;
2156
2006
  exports.getLastPromise = getLastPromise;
2157
2007
 
2008
+ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
2009
+
2010
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
2011
+
2012
+ function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
2013
+
2158
2014
  var lastPromise = undefined;
2159
2015
 
2160
2016
  var TestPromise = (function (_RSVP$Promise) {
2161
- babelHelpers.inherits(TestPromise, _RSVP$Promise);
2017
+ _inherits(TestPromise, _RSVP$Promise);
2162
2018
 
2163
2019
  function TestPromise() {
2164
- babelHelpers.classCallCheck(this, TestPromise);
2020
+ _classCallCheck(this, TestPromise);
2165
2021
 
2166
2022
  _RSVP$Promise.apply(this, arguments);
2167
2023
  lastPromise = this;
@@ -2181,6 +2037,12 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing
2181
2037
  @param {String} label An optional string for identifying the promise.
2182
2038
  */
2183
2039
 
2040
+ TestPromise.resolve = function resolve(val) {
2041
+ return new TestPromise(function (resolve) {
2042
+ return resolve(val);
2043
+ });
2044
+ };
2045
+
2184
2046
  TestPromise.prototype.then = function then(onFulfillment) {
2185
2047
  var _RSVP$Promise$prototype$then;
2186
2048
 
@@ -2194,7 +2056,7 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing
2194
2056
  };
2195
2057
 
2196
2058
  return TestPromise;
2197
- })(_emberRuntime.RSVP.Promise);
2059
+ })(_emberRuntimeExtRsvp.default.Promise);
2198
2060
 
2199
2061
  exports.default = TestPromise;
2200
2062
 
@@ -2215,8 +2077,10 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing
2215
2077
  @since 1.2.0
2216
2078
  */
2217
2079
 
2218
- function resolve(result, label) {
2219
- return TestPromise.resolve(result, label);
2080
+ function resolve(result) {
2081
+ return new TestPromise(function (resolve) {
2082
+ return resolve(result);
2083
+ });
2220
2084
  }
2221
2085
 
2222
2086
  function getLastPromise() {
@@ -2252,20 +2116,20 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing
2252
2116
  }
2253
2117
  }
2254
2118
  });
2255
- enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports, _emberMetal) {
2119
+ enifed('ember-testing/test/run', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) {
2256
2120
  'use strict';
2257
2121
 
2258
2122
  exports.default = run;
2259
2123
 
2260
2124
  function run(fn) {
2261
- if (!_emberMetal.run.currentRunLoop) {
2262
- return _emberMetal.run(fn);
2125
+ if (!_emberMetalRun_loop.default.currentRunLoop) {
2126
+ return _emberMetalRun_loop.default(fn);
2263
2127
  } else {
2264
2128
  return fn();
2265
2129
  }
2266
2130
  }
2267
2131
  });
2268
- enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (exports, _emberMetal) {
2132
+ enifed('ember-testing/test/waiters', ['exports', 'ember-metal/features', 'ember-metal/debug'], function (exports, _emberMetalFeatures, _emberMetalDebug) {
2269
2133
  'use strict';
2270
2134
 
2271
2135
  exports.registerWaiter = registerWaiter;
@@ -2279,10 +2143,7 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (expor
2279
2143
  /**
2280
2144
  This allows ember-testing to play nicely with other asynchronous
2281
2145
  events, such as an application that is waiting for a CSS3
2282
- transition or an IndexDB transaction. The waiter runs periodically
2283
- after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,
2284
- until the returning result is truthy. After the waiters finish, the next async helper
2285
- is executed and the process repeats.
2146
+ transition or an IndexDB transaction.
2286
2147
 
2287
2148
  For example:
2288
2149
 
@@ -2386,7 +2247,7 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (expor
2386
2247
  }
2387
2248
 
2388
2249
  function generateDeprecatedWaitersArray() {
2389
- _emberMetal.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', !true, { until: '2.8.0', id: 'ember-testing.test-waiters' });
2250
+ _emberMetalDebug.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', !true, { until: '2.8.0', id: 'ember-testing.test-waiters' });
2390
2251
 
2391
2252
  var array = new Array(callbacks.length);
2392
2253
  for (var i = 0; i < callbacks.length; i++) {