ember-source 1.11.0.beta.2.2 → 1.11.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ember-source might be problematic. Click here for more details.

@@ -5,7 +5,7 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 1.11.0-beta.2
8
+ * @version 1.11.0-beta.3.780ac356
9
9
  */
10
10
 
11
11
  (function() {
@@ -805,8 +805,8 @@ enifed('ember-testing/helpers', ['ember-metal/core', 'ember-metal/property_get',
805
805
  Example:
806
806
 
807
807
  ```javascript
808
- function validateRouteName(){
809
- equal(currentRouteName(), 'some.path', "correct route was transitioned into.");
808
+ function validateRouteName() {
809
+ equal(currentRouteName(), 'some.path', "correct route was transitioned into.");
810
810
  }
811
811
 
812
812
  visit('/some/path').then(validateRouteName)
@@ -824,8 +824,8 @@ enifed('ember-testing/helpers', ['ember-metal/core', 'ember-metal/property_get',
824
824
  Example:
825
825
 
826
826
  ```javascript
827
- function validateURL(){
828
- equal(currentPath(), 'some.path.index', "correct path was transitioned into.");
827
+ function validateURL() {
828
+ equal(currentPath(), 'some.path.index', "correct path was transitioned into.");
829
829
  }
830
830
 
831
831
  click('#some-link-id').then(validateURL);
@@ -843,8 +843,8 @@ enifed('ember-testing/helpers', ['ember-metal/core', 'ember-metal/property_get',
843
843
  Example:
844
844
 
845
845
  ```javascript
846
- function validateURL(){
847
- equal(currentURL(), '/some/path', "correct URL was transitioned into.");
846
+ function validateURL() {
847
+ equal(currentURL(), '/some/path', "correct URL was transitioned into.");
848
848
  }
849
849
 
850
850
  click('#some-link-id').then(validateURL);
@@ -5,7 +5,7 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 1.11.0-beta.2
8
+ * @version 1.11.0-beta.3.780ac356
9
9
  */
10
10
 
11
11
  (function() {
@@ -11147,6 +11147,28 @@ enifed('ember-htmlbars/tests/helpers/input_test', ['ember-metal/run_loop', 'embe
11147
11147
  equal(view.$('input').attr('tabindex'), "3", "updates text field after tabindex changes");
11148
11148
  });
11149
11149
 
11150
+ QUnit.test("cursor position is not lost when updating content", function() {
11151
+ equal(view.$('input').val(), "hello", "precondition - renders text field with value");
11152
+
11153
+ var $input = view.$('input');
11154
+ var input = $input[0];
11155
+
11156
+ // set the cursor position to 3 (no selection)
11157
+ run['default'](function() {
11158
+ input.value = 'derp';
11159
+ input.selectionStart = 3;
11160
+ input.selectionEnd = 3;
11161
+ });
11162
+
11163
+ run['default'](null, property_set.set, controller, 'val', 'derp');
11164
+
11165
+ equal(view.$('input').val(), "derp", "updates text field after value changes");
11166
+
11167
+ equal(input.selectionStart, 3, 'cursor position was not lost');
11168
+ equal(input.selectionEnd, 3, 'cursor position was not lost');
11169
+ });
11170
+
11171
+
11150
11172
  QUnit.module("{{input type='text'}} - static values", {
11151
11173
  setup: function() {
11152
11174
  controller = {};
@@ -14481,6 +14503,34 @@ enifed('ember-htmlbars/tests/helpers/yield_test', ['ember-metal/run_loop', 'embe
14481
14503
 
14482
14504
  });
14483
14505
 
14506
+ QUnit.test("simple bindings inside of a yielded template should work properly when the yield is nested inside of another view", function() {
14507
+ view = EmberView['default'].create({
14508
+ layout: compile['default']('{{#if view.falsy}}{{else}}{{yield}}{{/if}}'),
14509
+ template: compile['default']("{{view.text}}"),
14510
+ text: "ohai"
14511
+ });
14512
+
14513
+ run['default'](function() {
14514
+ view.createElement();
14515
+ });
14516
+
14517
+ equal(view.$().text(), "ohai");
14518
+ });
14519
+
14520
+ QUnit.test("nested simple bindings inside of a yielded template should work properly when the yield is nested inside of another view", function() {
14521
+ view = EmberView['default'].create({
14522
+ layout: compile['default']('{{#if view.falsy}}{{else}}{{yield}}{{/if}}'),
14523
+ template: compile['default']("{{#if view.falsy}}{{else}}{{view.text}}{{/if}}"),
14524
+ text: "ohai"
14525
+ });
14526
+
14527
+ run['default'](function() {
14528
+ view.createElement();
14529
+ });
14530
+
14531
+ equal(view.$().text(), "ohai");
14532
+ });
14533
+
14484
14534
  QUnit.module("ember-htmlbars: Component {{yield}}", {
14485
14535
  setup: function() {},
14486
14536
  teardown: function() {
@@ -16063,6 +16113,133 @@ enifed('ember-htmlbars/tests/integration/with_view_test.jshint', function () {
16063
16113
  ok(true, 'ember-htmlbars/tests/integration/with_view_test.js should pass jshint.');
16064
16114
  });
16065
16115
 
16116
+ });
16117
+ enifed('ember-htmlbars/tests/system/append-templated-view-test', ['ember-runtime/tests/utils', 'ember-views/views/view', 'ember-views/views/component', 'ember-template-compiler/system/compile'], function (utils, EmberView, EmberComponent, compile) {
16118
+
16119
+ 'use strict';
16120
+
16121
+ var view;
16122
+ QUnit.module('ember-htmlbars: appendTemplatedView', {
16123
+ teardown: function() {
16124
+ utils.runDestroy(view);
16125
+ }
16126
+ });
16127
+
16128
+ QUnit.test('can accept a view instance', function() {
16129
+ var controller = {
16130
+ someProp: 'controller context',
16131
+ someView: EmberView['default'].create({
16132
+ template: compile['default']('{{someProp}}')
16133
+ })
16134
+ };
16135
+
16136
+ view = EmberView['default'].create({
16137
+ controller: controller,
16138
+ template: compile['default']('{{someProp}} - {{view someView}}')
16139
+ });
16140
+
16141
+ utils.runAppend(view);
16142
+
16143
+ equal(view.$().text(), 'controller context - controller context');
16144
+ });
16145
+
16146
+ QUnit.test('can accept a view factory', function() {
16147
+ var controller = {
16148
+ someProp: 'controller context',
16149
+ someView: EmberView['default'].extend({
16150
+ template: compile['default']('{{someProp}}')
16151
+ })
16152
+ };
16153
+
16154
+ view = EmberView['default'].create({
16155
+ controller: controller,
16156
+ template: compile['default']('{{someProp}} - {{view someView}}')
16157
+ });
16158
+
16159
+ utils.runAppend(view);
16160
+
16161
+ equal(view.$().text(), 'controller context - controller context');
16162
+ });
16163
+
16164
+ QUnit.test('does change the context if the view factory has a controller specified', function() {
16165
+ var controller = {
16166
+ someProp: 'controller context',
16167
+ someView: EmberView['default'].extend({
16168
+ controller: {
16169
+ someProp: 'view local controller context'
16170
+ },
16171
+ template: compile['default']('{{someProp}}')
16172
+ })
16173
+ };
16174
+
16175
+ view = EmberView['default'].create({
16176
+ controller: controller,
16177
+ template: compile['default']('{{someProp}} - {{view someView}}')
16178
+ });
16179
+
16180
+ utils.runAppend(view);
16181
+
16182
+ equal(view.$().text(), 'controller context - view local controller context');
16183
+ });
16184
+
16185
+ QUnit.test('does change the context if a component factory is used', function() {
16186
+ var controller = {
16187
+ someProp: 'controller context',
16188
+ someView: EmberComponent['default'].extend({
16189
+ someProp: 'view local controller context',
16190
+ layout: compile['default']('{{someProp}}')
16191
+ })
16192
+ };
16193
+
16194
+ view = EmberView['default'].create({
16195
+ controller: controller,
16196
+ template: compile['default']('{{someProp}} - {{view someView}}')
16197
+ });
16198
+
16199
+ utils.runAppend(view);
16200
+
16201
+ equal(view.$().text(), 'controller context - view local controller context');
16202
+ });
16203
+
16204
+ QUnit.test('does change the context if a component instanced is used', function() {
16205
+ var controller = {
16206
+ someProp: 'controller context',
16207
+ someView: EmberComponent['default'].create({
16208
+ someProp: 'view local controller context',
16209
+ layout: compile['default']('{{someProp}}')
16210
+ })
16211
+ };
16212
+
16213
+ view = EmberView['default'].create({
16214
+ controller: controller,
16215
+ template: compile['default']('{{someProp}} - {{view someView}}')
16216
+ });
16217
+
16218
+ utils.runAppend(view);
16219
+
16220
+ equal(view.$().text(), 'controller context - view local controller context');
16221
+ });
16222
+
16223
+ });
16224
+ enifed('ember-htmlbars/tests/system/append-templated-view-test.jscs-test', function () {
16225
+
16226
+ 'use strict';
16227
+
16228
+ module('JSCS - ember-htmlbars/tests/system');
16229
+ test('ember-htmlbars/tests/system/append-templated-view-test.js should pass jscs', function() {
16230
+ ok(true, 'ember-htmlbars/tests/system/append-templated-view-test.js should pass jscs.');
16231
+ });
16232
+
16233
+ });
16234
+ enifed('ember-htmlbars/tests/system/append-templated-view-test.jshint', function () {
16235
+
16236
+ 'use strict';
16237
+
16238
+ module('JSHint - ember-htmlbars/tests/system');
16239
+ test('ember-htmlbars/tests/system/append-templated-view-test.js should pass jshint', function() {
16240
+ ok(true, 'ember-htmlbars/tests/system/append-templated-view-test.js should pass jshint.');
16241
+ });
16242
+
16066
16243
  });
16067
16244
  enifed('ember-htmlbars/tests/system/bootstrap_test', ['ember-views/system/jquery', 'ember-metal/run_loop', 'ember-views/views/view', 'ember-runtime/tests/utils', 'ember-htmlbars/system/bootstrap'], function (jQuery, run, EmberView, utils, bootstrap) {
16068
16245
 
@@ -16738,7 +16915,7 @@ enifed('ember-htmlbars/tests/system/render_view_test', ['ember-runtime/tests/uti
16738
16915
  view = EmberView['default'].create({
16739
16916
  template: {
16740
16917
  isHTMLBars: true,
16741
- revision: 'Ember@1.11.0-beta.2',
16918
+ revision: 'Ember@1.11.0-beta.3.780ac356',
16742
16919
  render: function(view, env, contextualElement, blockArguments) {
16743
16920
  for (var i = 0, l = keyNames.length; i < l; i++) {
16744
16921
  var keyName = keyNames[i];
@@ -51962,7 +52139,7 @@ enifed('ember-template-compiler/tests/system/compile_test', ['ember-template-com
51962
52139
 
51963
52140
  var actual = compile['default'](templateString);
51964
52141
 
51965
- equal(actual.revision, 'Ember@1.11.0-beta.2', 'revision is included in generated template');
52142
+ equal(actual.revision, 'Ember@1.11.0-beta.3.780ac356', 'revision is included in generated template');
51966
52143
  });
51967
52144
 
51968
52145
  QUnit.test('the template revision is different than the HTMLBars default revision', function() {
@@ -70492,6 +70669,31 @@ enifed('ember/tests/routing/basic_test', ['ember', 'ember-metal/enumerable_utils
70492
70669
  bootApplication();
70493
70670
  });
70494
70671
 
70672
+ QUnit.test("rejecting the model hooks promise with an error with `errorThrown` property prints `errorThrown.message` property", function() {
70673
+ var rejectedMessage = 'OMG!! SOOOOOO BAD!!!!';
70674
+ var rejectedStack = 'Yeah, buddy: stack gets printed too.';
70675
+
70676
+ Router.map(function() {
70677
+ this.route("yippie", { path: "/" });
70678
+ });
70679
+
70680
+ Ember.Logger.error = function(initialMessage, errorMessage, errorStack) {
70681
+ equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed');
70682
+ equal(errorMessage, rejectedMessage, "the rejected reason's message property is logged");
70683
+ equal(errorStack, rejectedStack, "the rejected reason's stack property is logged");
70684
+ };
70685
+
70686
+ App.YippieRoute = Ember.Route.extend({
70687
+ model: function() {
70688
+ return Ember.RSVP.reject({
70689
+ errorThrown: { message: rejectedMessage, stack: rejectedStack }
70690
+ });
70691
+ }
70692
+ });
70693
+
70694
+ bootApplication();
70695
+ });
70696
+
70495
70697
  QUnit.test("rejecting the model hooks promise with no reason still logs error", function() {
70496
70698
  Router.map(function() {
70497
70699
  this.route("wowzers", { path: "/" });
@@ -5,7 +5,7 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 1.11.0-beta.2
8
+ * @version 1.11.0-beta.3.780ac356
9
9
  */
10
10
 
11
11
  (function() {
@@ -13175,6 +13175,28 @@ enifed('ember-htmlbars/tests/helpers/input_test', ['ember-metal/run_loop', 'embe
13175
13175
  equal(view.$('input').attr('tabindex'), "3", "updates text field after tabindex changes");
13176
13176
  });
13177
13177
 
13178
+ QUnit.test("cursor position is not lost when updating content", function() {
13179
+ equal(view.$('input').val(), "hello", "precondition - renders text field with value");
13180
+
13181
+ var $input = view.$('input');
13182
+ var input = $input[0];
13183
+
13184
+ // set the cursor position to 3 (no selection)
13185
+ run['default'](function() {
13186
+ input.value = 'derp';
13187
+ input.selectionStart = 3;
13188
+ input.selectionEnd = 3;
13189
+ });
13190
+
13191
+ run['default'](null, property_set.set, controller, 'val', 'derp');
13192
+
13193
+ equal(view.$('input').val(), "derp", "updates text field after value changes");
13194
+
13195
+ equal(input.selectionStart, 3, 'cursor position was not lost');
13196
+ equal(input.selectionEnd, 3, 'cursor position was not lost');
13197
+ });
13198
+
13199
+
13178
13200
  QUnit.module("{{input type='text'}} - static values", {
13179
13201
  setup: function() {
13180
13202
  controller = {};
@@ -16509,6 +16531,34 @@ enifed('ember-htmlbars/tests/helpers/yield_test', ['ember-metal/run_loop', 'embe
16509
16531
 
16510
16532
  });
16511
16533
 
16534
+ QUnit.test("simple bindings inside of a yielded template should work properly when the yield is nested inside of another view", function() {
16535
+ view = EmberView['default'].create({
16536
+ layout: compile['default']('{{#if view.falsy}}{{else}}{{yield}}{{/if}}'),
16537
+ template: compile['default']("{{view.text}}"),
16538
+ text: "ohai"
16539
+ });
16540
+
16541
+ run['default'](function() {
16542
+ view.createElement();
16543
+ });
16544
+
16545
+ equal(view.$().text(), "ohai");
16546
+ });
16547
+
16548
+ QUnit.test("nested simple bindings inside of a yielded template should work properly when the yield is nested inside of another view", function() {
16549
+ view = EmberView['default'].create({
16550
+ layout: compile['default']('{{#if view.falsy}}{{else}}{{yield}}{{/if}}'),
16551
+ template: compile['default']("{{#if view.falsy}}{{else}}{{view.text}}{{/if}}"),
16552
+ text: "ohai"
16553
+ });
16554
+
16555
+ run['default'](function() {
16556
+ view.createElement();
16557
+ });
16558
+
16559
+ equal(view.$().text(), "ohai");
16560
+ });
16561
+
16512
16562
  QUnit.module("ember-htmlbars: Component {{yield}}", {
16513
16563
  setup: function() {},
16514
16564
  teardown: function() {
@@ -18091,6 +18141,133 @@ enifed('ember-htmlbars/tests/integration/with_view_test.jshint', function () {
18091
18141
  ok(true, 'ember-htmlbars/tests/integration/with_view_test.js should pass jshint.');
18092
18142
  });
18093
18143
 
18144
+ });
18145
+ enifed('ember-htmlbars/tests/system/append-templated-view-test', ['ember-runtime/tests/utils', 'ember-views/views/view', 'ember-views/views/component', 'ember-template-compiler/system/compile'], function (utils, EmberView, EmberComponent, compile) {
18146
+
18147
+ 'use strict';
18148
+
18149
+ var view;
18150
+ QUnit.module('ember-htmlbars: appendTemplatedView', {
18151
+ teardown: function() {
18152
+ utils.runDestroy(view);
18153
+ }
18154
+ });
18155
+
18156
+ QUnit.test('can accept a view instance', function() {
18157
+ var controller = {
18158
+ someProp: 'controller context',
18159
+ someView: EmberView['default'].create({
18160
+ template: compile['default']('{{someProp}}')
18161
+ })
18162
+ };
18163
+
18164
+ view = EmberView['default'].create({
18165
+ controller: controller,
18166
+ template: compile['default']('{{someProp}} - {{view someView}}')
18167
+ });
18168
+
18169
+ utils.runAppend(view);
18170
+
18171
+ equal(view.$().text(), 'controller context - controller context');
18172
+ });
18173
+
18174
+ QUnit.test('can accept a view factory', function() {
18175
+ var controller = {
18176
+ someProp: 'controller context',
18177
+ someView: EmberView['default'].extend({
18178
+ template: compile['default']('{{someProp}}')
18179
+ })
18180
+ };
18181
+
18182
+ view = EmberView['default'].create({
18183
+ controller: controller,
18184
+ template: compile['default']('{{someProp}} - {{view someView}}')
18185
+ });
18186
+
18187
+ utils.runAppend(view);
18188
+
18189
+ equal(view.$().text(), 'controller context - controller context');
18190
+ });
18191
+
18192
+ QUnit.test('does change the context if the view factory has a controller specified', function() {
18193
+ var controller = {
18194
+ someProp: 'controller context',
18195
+ someView: EmberView['default'].extend({
18196
+ controller: {
18197
+ someProp: 'view local controller context'
18198
+ },
18199
+ template: compile['default']('{{someProp}}')
18200
+ })
18201
+ };
18202
+
18203
+ view = EmberView['default'].create({
18204
+ controller: controller,
18205
+ template: compile['default']('{{someProp}} - {{view someView}}')
18206
+ });
18207
+
18208
+ utils.runAppend(view);
18209
+
18210
+ equal(view.$().text(), 'controller context - view local controller context');
18211
+ });
18212
+
18213
+ QUnit.test('does change the context if a component factory is used', function() {
18214
+ var controller = {
18215
+ someProp: 'controller context',
18216
+ someView: EmberComponent['default'].extend({
18217
+ someProp: 'view local controller context',
18218
+ layout: compile['default']('{{someProp}}')
18219
+ })
18220
+ };
18221
+
18222
+ view = EmberView['default'].create({
18223
+ controller: controller,
18224
+ template: compile['default']('{{someProp}} - {{view someView}}')
18225
+ });
18226
+
18227
+ utils.runAppend(view);
18228
+
18229
+ equal(view.$().text(), 'controller context - view local controller context');
18230
+ });
18231
+
18232
+ QUnit.test('does change the context if a component instanced is used', function() {
18233
+ var controller = {
18234
+ someProp: 'controller context',
18235
+ someView: EmberComponent['default'].create({
18236
+ someProp: 'view local controller context',
18237
+ layout: compile['default']('{{someProp}}')
18238
+ })
18239
+ };
18240
+
18241
+ view = EmberView['default'].create({
18242
+ controller: controller,
18243
+ template: compile['default']('{{someProp}} - {{view someView}}')
18244
+ });
18245
+
18246
+ utils.runAppend(view);
18247
+
18248
+ equal(view.$().text(), 'controller context - view local controller context');
18249
+ });
18250
+
18251
+ });
18252
+ enifed('ember-htmlbars/tests/system/append-templated-view-test.jscs-test', function () {
18253
+
18254
+ 'use strict';
18255
+
18256
+ module('JSCS - ember-htmlbars/tests/system');
18257
+ test('ember-htmlbars/tests/system/append-templated-view-test.js should pass jscs', function() {
18258
+ ok(true, 'ember-htmlbars/tests/system/append-templated-view-test.js should pass jscs.');
18259
+ });
18260
+
18261
+ });
18262
+ enifed('ember-htmlbars/tests/system/append-templated-view-test.jshint', function () {
18263
+
18264
+ 'use strict';
18265
+
18266
+ module('JSHint - ember-htmlbars/tests/system');
18267
+ test('ember-htmlbars/tests/system/append-templated-view-test.js should pass jshint', function() {
18268
+ ok(true, 'ember-htmlbars/tests/system/append-templated-view-test.js should pass jshint.');
18269
+ });
18270
+
18094
18271
  });
18095
18272
  enifed('ember-htmlbars/tests/system/bootstrap_test', ['ember-views/system/jquery', 'ember-metal/run_loop', 'ember-views/views/view', 'ember-runtime/tests/utils', 'ember-htmlbars/system/bootstrap'], function (jQuery, run, EmberView, utils, bootstrap) {
18096
18273
 
@@ -18766,7 +18943,7 @@ enifed('ember-htmlbars/tests/system/render_view_test', ['ember-runtime/tests/uti
18766
18943
  view = EmberView['default'].create({
18767
18944
  template: {
18768
18945
  isHTMLBars: true,
18769
- revision: 'Ember@1.11.0-beta.2',
18946
+ revision: 'Ember@1.11.0-beta.3.780ac356',
18770
18947
  render: function(view, env, contextualElement, blockArguments) {
18771
18948
  for (var i = 0, l = keyNames.length; i < l; i++) {
18772
18949
  var keyName = keyNames[i];
@@ -53836,7 +54013,7 @@ enifed('ember-template-compiler/tests/system/compile_test', ['ember-template-com
53836
54013
 
53837
54014
  var actual = compile['default'](templateString);
53838
54015
 
53839
- equal(actual.revision, 'Ember@1.11.0-beta.2', 'revision is included in generated template');
54016
+ equal(actual.revision, 'Ember@1.11.0-beta.3.780ac356', 'revision is included in generated template');
53840
54017
  });
53841
54018
 
53842
54019
  QUnit.test('the template revision is different than the HTMLBars default revision', function() {
@@ -72349,6 +72526,31 @@ enifed('ember/tests/routing/basic_test', ['ember', 'ember-metal/enumerable_utils
72349
72526
  bootApplication();
72350
72527
  });
72351
72528
 
72529
+ QUnit.test("rejecting the model hooks promise with an error with `errorThrown` property prints `errorThrown.message` property", function() {
72530
+ var rejectedMessage = 'OMG!! SOOOOOO BAD!!!!';
72531
+ var rejectedStack = 'Yeah, buddy: stack gets printed too.';
72532
+
72533
+ Router.map(function() {
72534
+ this.route("yippie", { path: "/" });
72535
+ });
72536
+
72537
+ Ember.Logger.error = function(initialMessage, errorMessage, errorStack) {
72538
+ equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed');
72539
+ equal(errorMessage, rejectedMessage, "the rejected reason's message property is logged");
72540
+ equal(errorStack, rejectedStack, "the rejected reason's stack property is logged");
72541
+ };
72542
+
72543
+ App.YippieRoute = Ember.Route.extend({
72544
+ model: function() {
72545
+ return Ember.RSVP.reject({
72546
+ errorThrown: { message: rejectedMessage, stack: rejectedStack }
72547
+ });
72548
+ }
72549
+ });
72550
+
72551
+ bootApplication();
72552
+ });
72553
+
72352
72554
  QUnit.test("rejecting the model hooks promise with no reason still logs error", function() {
72353
72555
  Router.map(function() {
72354
72556
  this.route("wowzers", { path: "/" });