Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cleanup] Remove unneeded getComputedPropertyDesc test helper #4101

Merged
merged 1 commit into from
Jan 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions tests/integration/relationships/belongs-to-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ var hasMany = DS.hasMany;
var belongsTo = DS.belongsTo;
var hash = Ember.RSVP.hash;

// Before https://github.com/emberjs/ember.js/pull/10323 the computed
// property descriptor was stored on the ember meta object. After that
// pr it was moved to the ember object. This code normalized that
// lookup because the Ember Data ci tests run against diferent version
// of Ember. Once that code reaches the release branch this code can
// be removed.
function getComputedPropertyDesc(model, key) {
if (Ember.meta(model).descs) {
return Ember.meta(model).descs[key];
}
var possibleDesc = model[key];
var desc = (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) ? possibleDesc : undefined;
return desc;
}

module("integration/relationship/belongs_to Belongs-To Relationships", {
beforeEach() {
User = DS.Model.extend({
Expand Down Expand Up @@ -563,7 +548,7 @@ test("relationshipsByName is cached in production", function(assert) {
var oldTesting = Ember.testing;
//We set the cacheable to true because that is the default state for any CP and then assert that it
//did not get dynamically changed when accessed
var relationshipsByName = getComputedPropertyDesc(model, 'relationshipsByName');
var relationshipsByName = model.relationshipsByName;
var oldCacheable = relationshipsByName._cacheable;
relationshipsByName._cacheable = true;
Ember.testing = false;
Expand All @@ -581,7 +566,7 @@ test("relatedTypes is cached in production", function(assert) {
var oldTesting = Ember.testing;
//We set the cacheable to true because that is the default state for any CP and then assert that it
//did not get dynamically changed when accessed
var relatedTypes = getComputedPropertyDesc(model, 'relatedTypes');
var relatedTypes = model.relatedTypes;
var oldCacheable = relatedTypes._cacheable;
relatedTypes._cacheable = true;
Ember.testing = false;
Expand All @@ -599,7 +584,7 @@ test("relationships is cached in production", function(assert) {
var oldTesting = Ember.testing;
//We set the cacheable to true because that is the default state for any CP and then assert that it
//did not get dynamically changed when accessed
var relationships = getComputedPropertyDesc(model, 'relationships');
var relationships = model.relationships;
var oldCacheable = relationships._cacheable;
relationships._cacheable = true;
Ember.testing = false;
Expand Down