ember-source 1.8.0 → 1.8.1

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b33e35e9eb1cef3a2c37e7598bd1081ad6ef83ef
4
- data.tar.gz: a500e9683ba0cef746f2feea7807019b5db6e36b
3
+ metadata.gz: 68eb4d3650e6f5f536f6b483a1f0b0aed126e5e8
4
+ data.tar.gz: e0024dc8af80f49eacaa2dfcbdaba2cdf2d283e7
5
5
  SHA512:
6
- metadata.gz: d5cfd0c87e7a02252582b429549eb05372100a5fc63154543532381d18df4e972188570f3725118f74304d56d077835c8ea80d975ca927054a339f682d927494
7
- data.tar.gz: c06fb64e52782641d053e753020a547fe847bcb1f52d08049f0963428a3728ececdcac94c2a43e504d0a9faf81b257b75482ab769776385975525f5e723c6f58
6
+ metadata.gz: 4932f47dd8ff3331add1a1ba9764f00460fff4d687d36a7c78d9624117c49ee794dcc7929a39dcbfec8f84ef8aba8e2b35e27d77b30e0fe0b3f54e4570910b46
7
+ data.tar.gz: 33355173606ee217c7f2720178c3432f014c13706644e46485f6fd0eabb0f1fc620609500016668f56bc4ed9fa697b8613e792b8d4b80c51a77620c98080753a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.8.1
@@ -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.8.0
8
+ * @version 1.8.1
9
9
  */
10
10
 
11
11
  (function() {
@@ -4765,7 +4765,7 @@ define("ember-metal/core",
4765
4765
 
4766
4766
  @class Ember
4767
4767
  @static
4768
- @version 1.8.0
4768
+ @version 1.8.1
4769
4769
  */
4770
4770
 
4771
4771
  if ('undefined' === typeof Ember) {
@@ -4792,10 +4792,10 @@ define("ember-metal/core",
4792
4792
  /**
4793
4793
  @property VERSION
4794
4794
  @type String
4795
- @default '1.8.0'
4795
+ @default '1.8.1'
4796
4796
  @static
4797
4797
  */
4798
- Ember.VERSION = '1.8.0';
4798
+ Ember.VERSION = '1.8.1';
4799
4799
 
4800
4800
  /**
4801
4801
  Standard environmental variables. You can define these in a global `EmberENV`
@@ -4955,8 +4955,12 @@ define("ember-metal/core",
4955
4955
  define("ember-metal/dependent_keys",
4956
4956
  ["ember-metal/platform","ember-metal/watching","exports"],
4957
4957
  function(__dependency1__, __dependency2__, __exports__) {
4958
- "use strict";
4959
- var create = __dependency1__.create;
4958
+ // Remove "use strict"; from transpiled module until
4959
+ // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
4960
+ //
4961
+ // REMOVE_USE_STRICT: true
4962
+
4963
+ var o_create = __dependency1__.create;
4960
4964
  var watch = __dependency2__.watch;
4961
4965
  var unwatch = __dependency2__.unwatch;
4962
4966
 
@@ -4964,8 +4968,6 @@ define("ember-metal/dependent_keys",
4964
4968
  @module ember-metal
4965
4969
  */
4966
4970
 
4967
- var o_create = create;
4968
-
4969
4971
  // ..........................................................
4970
4972
  // DEPENDENT KEYS
4971
4973
  //
@@ -5391,7 +5393,11 @@ define("ember-metal/error",
5391
5393
  define("ember-metal/events",
5392
5394
  ["ember-metal/core","ember-metal/utils","ember-metal/platform","exports"],
5393
5395
  function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
5394
- "use strict";
5396
+ // Remove "use strict"; from transpiled module until
5397
+ // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
5398
+ //
5399
+ // REMOVE_USE_STRICT: true
5400
+
5395
5401
  /**
5396
5402
  @module ember-metal
5397
5403
  */
@@ -7162,7 +7168,11 @@ define("ember-metal/merge",
7162
7168
  define("ember-metal/mixin",
7163
7169
  ["ember-metal/core","ember-metal/merge","ember-metal/array","ember-metal/platform","ember-metal/utils","ember-metal/expand_properties","ember-metal/properties","ember-metal/computed","ember-metal/binding","ember-metal/observer","ember-metal/events","exports"],
7164
7170
  function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {
7165
- "use strict";
7171
+ // Remove "use strict"; from transpiled module until
7172
+ // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
7173
+ //
7174
+ // REMOVE_USE_STRICT: true
7175
+
7166
7176
  /**
7167
7177
  @module ember
7168
7178
  @submodule ember-metal
@@ -9187,7 +9197,10 @@ define("ember-metal/property_set",
9187
9197
  propertyWillChange(obj, keyName);
9188
9198
 
9189
9199
  if (hasPropertyAccessors) {
9190
- if ((currentValue === undefined && !(keyName in obj)) || !obj.propertyIsEnumerable(keyName)) {
9200
+ if (
9201
+ (currentValue === undefined && !(keyName in obj)) ||
9202
+ !Object.prototype.propertyIsEnumerable.call(obj, keyName)
9203
+ ) {
9191
9204
  defineProperty(obj, keyName, null, value); // setup mandatory setter
9192
9205
  } else {
9193
9206
  meta.values[keyName] = value;
@@ -9934,7 +9947,11 @@ define("ember-metal/set_properties",
9934
9947
  define("ember-metal/utils",
9935
9948
  ["ember-metal/core","ember-metal/platform","ember-metal/array","exports"],
9936
9949
  function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
9937
- "use strict";
9950
+ // Remove "use strict"; from transpiled module until
9951
+ // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
9952
+ //
9953
+ // REMOVE_USE_STRICT: true
9954
+
9938
9955
  var Ember = __dependency1__["default"];
9939
9956
  var o_defineProperty = __dependency2__.defineProperty;
9940
9957
  var canDefineNonEnumerableProperties = __dependency2__.canDefineNonEnumerableProperties;
@@ -10855,7 +10872,7 @@ define("ember-metal/watch_key",
10855
10872
  m.values[keyName] = obj[keyName];
10856
10873
  o_defineProperty(obj, keyName, {
10857
10874
  configurable: true,
10858
- enumerable: obj.propertyIsEnumerable(keyName),
10875
+ enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName),
10859
10876
  set: MANDATORY_SETTER_FUNCTION(keyName),
10860
10877
  get: DEFAULT_GETTER_FUNCTION(keyName)
10861
10878
  });
@@ -10880,7 +10897,7 @@ define("ember-metal/watch_key",
10880
10897
  if (hasPropertyAccessors && keyName in obj) {
10881
10898
  o_defineProperty(obj, keyName, {
10882
10899
  configurable: true,
10883
- enumerable: obj.propertyIsEnumerable(keyName),
10900
+ enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName),
10884
10901
  set: function(val) {
10885
10902
  // redefine to set as enumerable
10886
10903
  o_defineProperty(obj, keyName, {
@@ -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.8.0
8
+ * @version 1.8.1
9
9
  */
10
10
 
11
11
  (function() {
@@ -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.8.0
8
+ * @version 1.8.1
9
9
  */
10
10
 
11
11
  (function() {
@@ -5705,8 +5705,8 @@ enifed("ember-handlebars/tests/controls/text_field_test.jshint",
5705
5705
  });
5706
5706
  });
5707
5707
  enifed("ember-handlebars/tests/handlebars_test",
5708
- ["ember-metal/core","ember-views/system/jquery","ember-metal/enumerable_utils","ember-metal/run_loop","ember-runtime/system/namespace","ember-views/views/view","ember-handlebars/views/metamorph_view","ember-handlebars","ember-runtime/system/object","ember-runtime/controllers/object_controller","ember-runtime/system/native_array","ember-metal/computed","ember-runtime/system/string","ember-metal/utils","ember-runtime/system/array_proxy","ember-views/views/collection_view","ember-views/views/container_view","ember-metal/binding","ember-metal/observer","ember-handlebars/controls/text_field","ember-runtime/system/container","ember-metal/logger","ember-handlebars/string","ember-metal/property_get","ember-metal/property_set"],
5709
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__) {
5708
+ ["ember-metal/core","ember-views/system/jquery","ember-metal/enumerable_utils","ember-metal/run_loop","ember-runtime/system/namespace","ember-views/views/view","ember-handlebars/views/metamorph_view","ember-handlebars","ember-runtime/system/object","ember-runtime/controllers/object_controller","ember-runtime/system/native_array","ember-metal/computed","ember-runtime/system/string","ember-metal/utils","ember-runtime/system/array_proxy","ember-views/views/collection_view","ember-views/views/container_view","ember-metal/binding","ember-metal/observer","ember-handlebars/controls/text_field","ember-runtime/system/container","ember-metal/logger","ember-metal/platform","ember-handlebars/string","ember-metal/property_get","ember-metal/property_set"],
5709
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__) {
5710
5710
  "use strict";
5711
5711
  /*jshint newcap:false*/
5712
5712
  var Ember = __dependency1__["default"];
@@ -5733,13 +5733,14 @@ enifed("ember-handlebars/tests/handlebars_test",
5733
5733
  var TextField = __dependency20__["default"];
5734
5734
  var Container = __dependency21__["default"];
5735
5735
  var Logger = __dependency22__["default"];
5736
+ var o_create = __dependency23__.create;
5736
5737
 
5737
- var htmlSafe = __dependency23__["default"];
5738
+ var htmlSafe = __dependency24__["default"];
5738
5739
 
5739
5740
  var trim = jQuery.trim;
5740
5741
 
5741
- var get = __dependency24__.get;
5742
- var set = __dependency25__.set;
5742
+ var get = __dependency25__.get;
5743
+ var set = __dependency26__.set;
5743
5744
 
5744
5745
  function firstGrandchild(view) {
5745
5746
  return get(get(view, 'childViews').objectAt(0), 'childViews').objectAt(0);
@@ -5970,6 +5971,56 @@ enifed("ember-handlebars/tests/handlebars_test",
5970
5971
  equal(view.$().text(), 'Gwar');
5971
5972
  });
5972
5973
 
5974
+ test("should read a number value", function() {
5975
+ var context = { aNumber: 1 };
5976
+ view = EmberView.create({
5977
+ context: context,
5978
+ template: EmberHandlebars.compile('{{aNumber}}')
5979
+ });
5980
+
5981
+ appendView();
5982
+ equal(view.$().text(), '1');
5983
+
5984
+ Ember.run(function(){
5985
+ Ember.set(context, 'aNumber', 2);
5986
+ });
5987
+ equal(view.$().text(), '2');
5988
+ });
5989
+
5990
+ test("should read an escaped number value", function() {
5991
+ var context = { aNumber: 1 };
5992
+ view = EmberView.create({
5993
+ context: context,
5994
+ template: EmberHandlebars.compile('{{{aNumber}}}')
5995
+ });
5996
+
5997
+ appendView();
5998
+ equal(view.$().text(), '1');
5999
+
6000
+ Ember.run(function(){
6001
+ Ember.set(context, 'aNumber', 2);
6002
+ });
6003
+ equal(view.$().text(), '2');
6004
+ });
6005
+
6006
+ test("should read from an Object.create(null)", function() {
6007
+ // Use ember's polyfill for Object.create
6008
+ var nullObject = o_create(null);
6009
+ nullObject['foo'] = 'bar';
6010
+ view = EmberView.create({
6011
+ context: { nullObject: nullObject },
6012
+ template: EmberHandlebars.compile('{{nullObject.foo}}')
6013
+ });
6014
+
6015
+ appendView();
6016
+ equal(view.$().text(), 'bar');
6017
+
6018
+ Ember.run(function(){
6019
+ Ember.set(nullObject, 'foo', 'baz');
6020
+ });
6021
+ equal(view.$().text(), 'baz');
6022
+ });
6023
+
5973
6024
  test("htmlSafe should return an instance of Handlebars.SafeString", function() {
5974
6025
  var safeString = htmlSafe("you need to be more <b>bold</b>");
5975
6026
 
@@ -6922,6 +6973,108 @@ enifed("ember-handlebars/tests/handlebars_test",
6922
6973
  equal(view.$('#bar').text(), 'baz', "emits content");
6923
6974
  });
6924
6975
 
6976
+ test("{{view}} should be able to point to a local instance of view", function() {
6977
+ view = EmberView.create({
6978
+ template: EmberHandlebars.compile("{{view view.common}}"),
6979
+
6980
+ common: EmberView.create({
6981
+ template: EmberHandlebars.compile("common")
6982
+ })
6983
+ });
6984
+
6985
+ appendView();
6986
+
6987
+ equal(view.$().text(), "common", "tries to look up view name locally");
6988
+ });
6989
+
6990
+ test("{{view}} should be able to point to a local subclass of view", function() {
6991
+ var MyView = EmberView.extend();
6992
+ view = EmberView.create({
6993
+ template: EmberHandlebars.compile("{{view view.subclassed}}"),
6994
+ subclassed: MyView.extend({
6995
+ template: EmberHandlebars.compile("subclassed")
6996
+ })
6997
+ });
6998
+
6999
+ appendView();
7000
+
7001
+ equal(view.$().text(), "subclassed", "tries to look up view name locally");
7002
+ });
7003
+
7004
+ test("{{view}} should be able to point to a local instance of subclass of view", function() {
7005
+ var MyView = EmberView.extend();
7006
+ view = EmberView.create({
7007
+ template: EmberHandlebars.compile("{{view view.subclassed}}"),
7008
+ subclassed: MyView.create({
7009
+ template: EmberHandlebars.compile("subclassed")
7010
+ })
7011
+ });
7012
+
7013
+ appendView();
7014
+
7015
+ equal(view.$().text(), "subclassed", "tries to look up view name locally");
7016
+ });
7017
+
7018
+ test("{{view}} asserts that a view class is present", function() {
7019
+ var MyView = EmberObject.extend();
7020
+ view = EmberView.create({
7021
+ template: EmberHandlebars.compile("{{view view.notView}}"),
7022
+ notView: MyView.extend({
7023
+ template: EmberHandlebars.compile("notView")
7024
+ })
7025
+ });
7026
+
7027
+ expectAssertion(function(){
7028
+ appendView();
7029
+ }, /must be a subclass or an instance of Ember.View/);
7030
+ });
7031
+
7032
+ test("{{view}} asserts that a view class is present off controller", function() {
7033
+ var MyView = EmberObject.extend();
7034
+ view = EmberView.create({
7035
+ template: EmberHandlebars.compile("{{view notView}}"),
7036
+ controller: EmberObject.create({
7037
+ notView: MyView.extend({
7038
+ template: EmberHandlebars.compile("notView")
7039
+ })
7040
+ })
7041
+ });
7042
+
7043
+ expectAssertion(function(){
7044
+ appendView();
7045
+ }, /must be a subclass or an instance of Ember.View/);
7046
+ });
7047
+
7048
+ test("{{view}} asserts that a view instance is present", function() {
7049
+ var MyView = EmberObject.extend();
7050
+ view = EmberView.create({
7051
+ template: EmberHandlebars.compile("{{view view.notView}}"),
7052
+ notView: MyView.create({
7053
+ template: EmberHandlebars.compile("notView")
7054
+ })
7055
+ });
7056
+
7057
+ expectAssertion(function(){
7058
+ appendView();
7059
+ }, /must be a subclass or an instance of Ember.View/);
7060
+ });
7061
+
7062
+ test("{{view}} asserts that a view subclass instance is present off controller", function() {
7063
+ var MyView = EmberObject.extend();
7064
+ view = EmberView.create({
7065
+ template: EmberHandlebars.compile("{{view notView}}"),
7066
+ controller: EmberObject.create({
7067
+ notView: MyView.create({
7068
+ template: EmberHandlebars.compile("notView")
7069
+ })
7070
+ })
7071
+ });
7072
+
7073
+ expectAssertion(function(){
7074
+ appendView();
7075
+ }, /must be a subclass or an instance of Ember.View/);
7076
+ });
7077
+
6925
7078
  test("{{view}} tag attribute should set tagName of the view", function() {
6926
7079
  container.register('template:foo', EmberHandlebars.compile('{{#view view.tagView tag="span"}}baz{{/view}}'));
6927
7080
 
@@ -9181,6 +9334,31 @@ enifed("ember-handlebars/tests/helpers/each_test",
9181
9334
  assertHTML(view, "Steve HoltKazukiFirestoneMcMunch");
9182
9335
  });
9183
9336
 
9337
+ test("it does not mark each option tag as selected", function() {
9338
+ var selectView = EmberView.create({
9339
+ template: templateFor('<select id="people-select"><option value="">Please select a name</option>{{#each view.people}}<option {{bind-attr value=name}}>{{name}}</option>{{/each}}</select>'),
9340
+ people: people
9341
+ });
9342
+
9343
+ append(selectView);
9344
+
9345
+ equal(selectView.$('option').length, 3, "renders 3 <option> elements");
9346
+
9347
+ equal(selectView.$().find(':selected').text(), 'Please select a name', 'first option is selected');
9348
+
9349
+ run(function() {
9350
+ people.pushObject({name: "Black Francis"});
9351
+ });
9352
+
9353
+ equal(selectView.$().find(':selected').text(), 'Please select a name', 'first option is selected');
9354
+
9355
+ equal(selectView.$('option').length, 4, "renders an additional <option> element when an object is added");
9356
+
9357
+ run(function() {
9358
+ selectView.destroy();
9359
+ });
9360
+ });
9361
+
9184
9362
  test("it works inside a ul element", function() {
9185
9363
  var ulView = EmberView.create({
9186
9364
  template: templateFor('<ul>{{#each view.people}}<li>{{name}}</li>{{/each}}</ul>'),
@@ -49370,6 +49548,16 @@ enifed("ember-views/tests/views/view/attribute_bindings_test",
49370
49548
  }
49371
49549
  ok(!error, error);
49372
49550
  });
49551
+
49552
+ test("asserts if an attributeBinding is setup on class", function() {
49553
+ view = EmberView.create({
49554
+ attributeBindings: ['class']
49555
+ });
49556
+
49557
+ expectAssertion(function() {
49558
+ appendView();
49559
+ }, 'You cannot use class as an attributeBinding, use classNameBindings instead.');
49560
+ });
49373
49561
  });
49374
49562
  enifed("ember-views/tests/views/view/attribute_bindings_test.jshint",
49375
49563
  [],
@@ -50095,6 +50283,22 @@ enifed("ember-views/tests/views/view/create_element_test",
50095
50283
  equal(ret, view, 'returns receiver');
50096
50284
  });
50097
50285
 
50286
+ test('should assert if `tagName` is an empty string and `classNameBindings` are specified', function() {
50287
+ expect(1);
50288
+
50289
+ view = EmberView.create({
50290
+ tagName: '',
50291
+ foo: true,
50292
+ classNameBindings: ['foo:is-foo:is-bar']
50293
+ });
50294
+
50295
+ expectAssertion(function(){
50296
+ run(function(){
50297
+ view.createElement();
50298
+ });
50299
+ }, /You cannot use `classNameBindings` on a tag-less view/);
50300
+ });
50301
+
50098
50302
  test("calls render and turns resultant string into element", function() {
50099
50303
  view = EmberView.create({
50100
50304
  tagName: 'span',
@@ -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.8.0
8
+ * @version 1.8.1
9
9
  */
10
10
 
11
11
  (function() {
@@ -5705,8 +5705,8 @@ enifed("ember-handlebars/tests/controls/text_field_test.jshint",
5705
5705
  });
5706
5706
  });
5707
5707
  enifed("ember-handlebars/tests/handlebars_test",
5708
- ["ember-metal/core","ember-views/system/jquery","ember-metal/enumerable_utils","ember-metal/run_loop","ember-runtime/system/namespace","ember-views/views/view","ember-handlebars/views/metamorph_view","ember-handlebars","ember-runtime/system/object","ember-runtime/controllers/object_controller","ember-runtime/system/native_array","ember-metal/computed","ember-runtime/system/string","ember-metal/utils","ember-runtime/system/array_proxy","ember-views/views/collection_view","ember-views/views/container_view","ember-metal/binding","ember-metal/observer","ember-handlebars/controls/text_field","ember-runtime/system/container","ember-metal/logger","ember-handlebars/string","ember-metal/property_get","ember-metal/property_set"],
5709
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__) {
5708
+ ["ember-metal/core","ember-views/system/jquery","ember-metal/enumerable_utils","ember-metal/run_loop","ember-runtime/system/namespace","ember-views/views/view","ember-handlebars/views/metamorph_view","ember-handlebars","ember-runtime/system/object","ember-runtime/controllers/object_controller","ember-runtime/system/native_array","ember-metal/computed","ember-runtime/system/string","ember-metal/utils","ember-runtime/system/array_proxy","ember-views/views/collection_view","ember-views/views/container_view","ember-metal/binding","ember-metal/observer","ember-handlebars/controls/text_field","ember-runtime/system/container","ember-metal/logger","ember-metal/platform","ember-handlebars/string","ember-metal/property_get","ember-metal/property_set"],
5709
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__) {
5710
5710
  "use strict";
5711
5711
  /*jshint newcap:false*/
5712
5712
  var Ember = __dependency1__["default"];
@@ -5733,13 +5733,14 @@ enifed("ember-handlebars/tests/handlebars_test",
5733
5733
  var TextField = __dependency20__["default"];
5734
5734
  var Container = __dependency21__["default"];
5735
5735
  var Logger = __dependency22__["default"];
5736
+ var o_create = __dependency23__.create;
5736
5737
 
5737
- var htmlSafe = __dependency23__["default"];
5738
+ var htmlSafe = __dependency24__["default"];
5738
5739
 
5739
5740
  var trim = jQuery.trim;
5740
5741
 
5741
- var get = __dependency24__.get;
5742
- var set = __dependency25__.set;
5742
+ var get = __dependency25__.get;
5743
+ var set = __dependency26__.set;
5743
5744
 
5744
5745
  function firstGrandchild(view) {
5745
5746
  return get(get(view, 'childViews').objectAt(0), 'childViews').objectAt(0);
@@ -5970,6 +5971,56 @@ enifed("ember-handlebars/tests/handlebars_test",
5970
5971
  equal(view.$().text(), 'Gwar');
5971
5972
  });
5972
5973
 
5974
+ test("should read a number value", function() {
5975
+ var context = { aNumber: 1 };
5976
+ view = EmberView.create({
5977
+ context: context,
5978
+ template: EmberHandlebars.compile('{{aNumber}}')
5979
+ });
5980
+
5981
+ appendView();
5982
+ equal(view.$().text(), '1');
5983
+
5984
+ Ember.run(function(){
5985
+ Ember.set(context, 'aNumber', 2);
5986
+ });
5987
+ equal(view.$().text(), '2');
5988
+ });
5989
+
5990
+ test("should read an escaped number value", function() {
5991
+ var context = { aNumber: 1 };
5992
+ view = EmberView.create({
5993
+ context: context,
5994
+ template: EmberHandlebars.compile('{{{aNumber}}}')
5995
+ });
5996
+
5997
+ appendView();
5998
+ equal(view.$().text(), '1');
5999
+
6000
+ Ember.run(function(){
6001
+ Ember.set(context, 'aNumber', 2);
6002
+ });
6003
+ equal(view.$().text(), '2');
6004
+ });
6005
+
6006
+ test("should read from an Object.create(null)", function() {
6007
+ // Use ember's polyfill for Object.create
6008
+ var nullObject = o_create(null);
6009
+ nullObject['foo'] = 'bar';
6010
+ view = EmberView.create({
6011
+ context: { nullObject: nullObject },
6012
+ template: EmberHandlebars.compile('{{nullObject.foo}}')
6013
+ });
6014
+
6015
+ appendView();
6016
+ equal(view.$().text(), 'bar');
6017
+
6018
+ Ember.run(function(){
6019
+ Ember.set(nullObject, 'foo', 'baz');
6020
+ });
6021
+ equal(view.$().text(), 'baz');
6022
+ });
6023
+
5973
6024
  test("htmlSafe should return an instance of Handlebars.SafeString", function() {
5974
6025
  var safeString = htmlSafe("you need to be more <b>bold</b>");
5975
6026
 
@@ -6922,6 +6973,108 @@ enifed("ember-handlebars/tests/handlebars_test",
6922
6973
  equal(view.$('#bar').text(), 'baz', "emits content");
6923
6974
  });
6924
6975
 
6976
+ test("{{view}} should be able to point to a local instance of view", function() {
6977
+ view = EmberView.create({
6978
+ template: EmberHandlebars.compile("{{view view.common}}"),
6979
+
6980
+ common: EmberView.create({
6981
+ template: EmberHandlebars.compile("common")
6982
+ })
6983
+ });
6984
+
6985
+ appendView();
6986
+
6987
+ equal(view.$().text(), "common", "tries to look up view name locally");
6988
+ });
6989
+
6990
+ test("{{view}} should be able to point to a local subclass of view", function() {
6991
+ var MyView = EmberView.extend();
6992
+ view = EmberView.create({
6993
+ template: EmberHandlebars.compile("{{view view.subclassed}}"),
6994
+ subclassed: MyView.extend({
6995
+ template: EmberHandlebars.compile("subclassed")
6996
+ })
6997
+ });
6998
+
6999
+ appendView();
7000
+
7001
+ equal(view.$().text(), "subclassed", "tries to look up view name locally");
7002
+ });
7003
+
7004
+ test("{{view}} should be able to point to a local instance of subclass of view", function() {
7005
+ var MyView = EmberView.extend();
7006
+ view = EmberView.create({
7007
+ template: EmberHandlebars.compile("{{view view.subclassed}}"),
7008
+ subclassed: MyView.create({
7009
+ template: EmberHandlebars.compile("subclassed")
7010
+ })
7011
+ });
7012
+
7013
+ appendView();
7014
+
7015
+ equal(view.$().text(), "subclassed", "tries to look up view name locally");
7016
+ });
7017
+
7018
+ test("{{view}} asserts that a view class is present", function() {
7019
+ var MyView = EmberObject.extend();
7020
+ view = EmberView.create({
7021
+ template: EmberHandlebars.compile("{{view view.notView}}"),
7022
+ notView: MyView.extend({
7023
+ template: EmberHandlebars.compile("notView")
7024
+ })
7025
+ });
7026
+
7027
+ expectAssertion(function(){
7028
+ appendView();
7029
+ }, /must be a subclass or an instance of Ember.View/);
7030
+ });
7031
+
7032
+ test("{{view}} asserts that a view class is present off controller", function() {
7033
+ var MyView = EmberObject.extend();
7034
+ view = EmberView.create({
7035
+ template: EmberHandlebars.compile("{{view notView}}"),
7036
+ controller: EmberObject.create({
7037
+ notView: MyView.extend({
7038
+ template: EmberHandlebars.compile("notView")
7039
+ })
7040
+ })
7041
+ });
7042
+
7043
+ expectAssertion(function(){
7044
+ appendView();
7045
+ }, /must be a subclass or an instance of Ember.View/);
7046
+ });
7047
+
7048
+ test("{{view}} asserts that a view instance is present", function() {
7049
+ var MyView = EmberObject.extend();
7050
+ view = EmberView.create({
7051
+ template: EmberHandlebars.compile("{{view view.notView}}"),
7052
+ notView: MyView.create({
7053
+ template: EmberHandlebars.compile("notView")
7054
+ })
7055
+ });
7056
+
7057
+ expectAssertion(function(){
7058
+ appendView();
7059
+ }, /must be a subclass or an instance of Ember.View/);
7060
+ });
7061
+
7062
+ test("{{view}} asserts that a view subclass instance is present off controller", function() {
7063
+ var MyView = EmberObject.extend();
7064
+ view = EmberView.create({
7065
+ template: EmberHandlebars.compile("{{view notView}}"),
7066
+ controller: EmberObject.create({
7067
+ notView: MyView.create({
7068
+ template: EmberHandlebars.compile("notView")
7069
+ })
7070
+ })
7071
+ });
7072
+
7073
+ expectAssertion(function(){
7074
+ appendView();
7075
+ }, /must be a subclass or an instance of Ember.View/);
7076
+ });
7077
+
6925
7078
  test("{{view}} tag attribute should set tagName of the view", function() {
6926
7079
  container.register('template:foo', EmberHandlebars.compile('{{#view view.tagView tag="span"}}baz{{/view}}'));
6927
7080
 
@@ -9181,6 +9334,31 @@ enifed("ember-handlebars/tests/helpers/each_test",
9181
9334
  assertHTML(view, "Steve HoltKazukiFirestoneMcMunch");
9182
9335
  });
9183
9336
 
9337
+ test("it does not mark each option tag as selected", function() {
9338
+ var selectView = EmberView.create({
9339
+ template: templateFor('<select id="people-select"><option value="">Please select a name</option>{{#each view.people}}<option {{bind-attr value=name}}>{{name}}</option>{{/each}}</select>'),
9340
+ people: people
9341
+ });
9342
+
9343
+ append(selectView);
9344
+
9345
+ equal(selectView.$('option').length, 3, "renders 3 <option> elements");
9346
+
9347
+ equal(selectView.$().find(':selected').text(), 'Please select a name', 'first option is selected');
9348
+
9349
+ run(function() {
9350
+ people.pushObject({name: "Black Francis"});
9351
+ });
9352
+
9353
+ equal(selectView.$().find(':selected').text(), 'Please select a name', 'first option is selected');
9354
+
9355
+ equal(selectView.$('option').length, 4, "renders an additional <option> element when an object is added");
9356
+
9357
+ run(function() {
9358
+ selectView.destroy();
9359
+ });
9360
+ });
9361
+
9184
9362
  test("it works inside a ul element", function() {
9185
9363
  var ulView = EmberView.create({
9186
9364
  template: templateFor('<ul>{{#each view.people}}<li>{{name}}</li>{{/each}}</ul>'),
@@ -49322,6 +49500,16 @@ enifed("ember-views/tests/views/view/attribute_bindings_test",
49322
49500
  }
49323
49501
  ok(!error, error);
49324
49502
  });
49503
+
49504
+ test("asserts if an attributeBinding is setup on class", function() {
49505
+ view = EmberView.create({
49506
+ attributeBindings: ['class']
49507
+ });
49508
+
49509
+ expectAssertion(function() {
49510
+ appendView();
49511
+ }, 'You cannot use class as an attributeBinding, use classNameBindings instead.');
49512
+ });
49325
49513
  });
49326
49514
  enifed("ember-views/tests/views/view/attribute_bindings_test.jshint",
49327
49515
  [],
@@ -50047,6 +50235,22 @@ enifed("ember-views/tests/views/view/create_element_test",
50047
50235
  equal(ret, view, 'returns receiver');
50048
50236
  });
50049
50237
 
50238
+ test('should assert if `tagName` is an empty string and `classNameBindings` are specified', function() {
50239
+ expect(1);
50240
+
50241
+ view = EmberView.create({
50242
+ tagName: '',
50243
+ foo: true,
50244
+ classNameBindings: ['foo:is-foo:is-bar']
50245
+ });
50246
+
50247
+ expectAssertion(function(){
50248
+ run(function(){
50249
+ view.createElement();
50250
+ });
50251
+ }, /You cannot use `classNameBindings` on a tag-less view/);
50252
+ });
50253
+
50050
50254
  test("calls render and turns resultant string into element", function() {
50051
50255
  view = EmberView.create({
50052
50256
  tagName: 'span',