Skip to content

Commit

Permalink
Merge pull request #4164 from pangratz/string-theory
Browse files Browse the repository at this point in the history
[CLEANUP] remove `toString` definitions for models in tests
  • Loading branch information
bmac committed Feb 16, 2016
2 parents 6a9e096 + 377e7f1 commit f4d3b9e
Show file tree
Hide file tree
Showing 26 changed files with 0 additions and 132 deletions.
4 changes: 0 additions & 4 deletions tests/integration/adapter/build-url-mixin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ module("integration/adapter/build-url-mixin - BuildURLMixin with RESTAdapter", {
name: DS.attr("string")
});

Post.toString = function() {
return "Post";
};

Comment = DS.Model.extend({
name: DS.attr("string")
});
Expand Down
1 change: 0 additions & 1 deletion tests/integration/adapter/record-persistence-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module("integration/adapter/record_persistence - Persisting Records", {
firstName: attr('string'),
lastName: attr('string')
});
Person.toString = function() { return "Person"; };

env = setupStore({
adapter: DS.Adapter.extend({
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/adapter/rest-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ module("integration/adapter/rest_adapter - REST Adapter", {
name: DS.attr("string")
});

Post.toString = function() {
return "Post";
};

Comment = DS.Model.extend({
name: DS.attr("string")
});
Expand Down
1 change: 0 additions & 1 deletion tests/integration/debug-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module("DS.DebugAdapter", {
beforeEach() {
Ember.run(function() {
App = Ember.Application.create();
App.toString = function() { return 'App'; };

App.StoreService = DS.Store.extend({});

Expand Down
4 changes: 0 additions & 4 deletions tests/integration/record-array-manager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ var Person = DS.Model.extend({
cars: DS.hasMany('car', { async: false })
});

Person.toString = function() { return "Person"; };

var Car = DS.Model.extend({
make: DS.attr('string'),
model: DS.attr('string'),
person: DS.belongsTo('person', { async: false })
});

Car.toString = function() { return "Car"; };

var manager;

module("integration/record_array_manager", {
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/records/collection-save-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ module("integration/records/collection_save - Save Collection of Records", {
title: DS.attr('string')
});

Post.toString = function() { return "Post"; };

env = setupStore({ post: Post });
},

Expand Down
2 changes: 0 additions & 2 deletions tests/integration/records/delete-record-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ module("integration/deletedRecord - Deleting Records", {
name: attr('string')
});

Person.toString = function() { return "Person"; };

env = setupStore({
person: Person
});
Expand Down
1 change: 0 additions & 1 deletion tests/integration/records/error-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module('integration/records/error', {
firstName: attr('string'),
lastName: attr('string')
});
Person.toString = function() { return 'Person'; };

env = setupStore({
person: Person
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/records/load-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ module("integration/load - Loading Records", {

Comment = DS.Model.extend();

Post.toString = function() { return "Post"; };
Comment.toString = function() { return "Comment"; };

env = setupStore({ post: Post, comment: Comment });
},

Expand Down
1 change: 0 additions & 1 deletion tests/integration/records/property-changes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module('integration/records/property-changes - Property changes', {
firstName: attr('string'),
lastName: attr('string')
});
Person.toString = function() { return 'Person'; };

env = setupStore({
person: Person
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/records/reload-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ module("integration/reload - Reloading Records", {
lastName: attr('string')
});

Person.toString = function() { return "Person"; };

env = setupStore({ person: Person });
},

Expand Down
2 changes: 0 additions & 2 deletions tests/integration/records/save-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ module("integration/records/save - Save Record", {
title: DS.attr('string')
});

Post.toString = function() { return "Post"; };

env = setupStore({ post: Post });
},

Expand Down
6 changes: 0 additions & 6 deletions tests/integration/records/unload-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@ var Person = DS.Model.extend({
cars: hasMany('car', { async: false })
});

Person.toString = function() { return "Person"; };

var Group = DS.Model.extend({
people: hasMany('person', { async: false })
});

Group.toString = function() { return "Group"; };

var Car = DS.Model.extend({
make: attr('string'),
model: attr('string'),
person: belongsTo('person', { async: false })
});

Car.toString = function() { return "Car"; };

module("integration/unload - Unloading Records", {
beforeEach() {
env = setupStore({
Expand Down
10 changes: 0 additions & 10 deletions tests/integration/relationships/has-many-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ var attr = DS.attr;
var hasMany = DS.hasMany;
var belongsTo = DS.belongsTo;

function stringify(string) {
return function() { return string; };
}

module("integration/relationships/has_many - Has-Many Relationships", {
beforeEach() {
User = DS.Model.extend({
Expand All @@ -43,37 +39,31 @@ module("integration/relationships/has_many - Has-Many Relationships", {
user: belongsTo('user', { async: false }),
created_at: attr('date')
});
Message.toString = stringify('Message');

Post = Message.extend({
title: attr('string'),
comments: hasMany('comment', { async: false })
});
Post.toString = stringify('Post');

Comment = Message.extend({
body: DS.attr('string'),
message: DS.belongsTo('post', { polymorphic: true, async: true })
});
Comment.toString = stringify('Comment');

Book = DS.Model.extend({
title: attr(),
chapters: hasMany('chapter', { async: true })
});
Book.toString = stringify('Book');

Chapter = DS.Model.extend({
title: attr(),
pages: hasMany('page', { async: false })
});
Chapter.toString = stringify('Chapter');

Page = DS.Model.extend({
number: attr('number'),
chapter: belongsTo('chapter', { async: false })
});
Page.toString = stringify('Page');

env = setupStore({
user: User,
Expand Down
10 changes: 0 additions & 10 deletions tests/integration/relationships/many-to-many-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ var run = Ember.run;
var attr = DS.attr;
var hasMany = DS.hasMany;

function stringify(string) {
return function() { return string; };
}

module('integration/relationships/many_to_many_test - ManyToMany relationships', {
beforeEach() {
User = DS.Model.extend({
Expand All @@ -23,22 +19,16 @@ module('integration/relationships/many_to_many_test - ManyToMany relationships',
accounts: hasMany('account', { async: false })
});

User.toString = stringify('User');

Account = DS.Model.extend({
state: attr(),
users: hasMany('user', { async: false })
});

Account.toString = stringify('Account');

Topic = DS.Model.extend({
title: attr('string'),
users: hasMany('user', { async: true })
});

Topic.toString = stringify('Topic');

env = setupStore({
user: User,
topic: Topic,
Expand Down
7 changes: 0 additions & 7 deletions tests/integration/relationships/one-to-many-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,23 @@ var attr = DS.attr;
var hasMany = DS.hasMany;
var belongsTo = DS.belongsTo;

function stringify(string) {
return function() { return string; };
}

module('integration/relationships/one_to_many_test - OneToMany relationships', {
beforeEach() {
User = DS.Model.extend({
name: attr('string'),
messages: hasMany('message', { async: true }),
accounts: hasMany('account', { async: false })
});
User.toString = stringify('User');

Account = DS.Model.extend({
state: attr(),
user: belongsTo('user', { async: false })
});
Account.toString = stringify('Account');

Message = DS.Model.extend({
title: attr('string'),
user: belongsTo('user', { async: true })
});
Message.toString = stringify('Message');

env = setupStore({
user: User,
Expand Down
6 changes: 0 additions & 6 deletions tests/integration/relationships/one-to-one-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,18 @@ var run = Ember.run;
var attr = DS.attr;
var belongsTo = DS.belongsTo;

function stringify(string) {
return function() { return string; };
}

module('integration/relationships/one_to_one_test - OneToOne relationships', {
beforeEach() {
User = DS.Model.extend({
name: attr('string'),
bestFriend: belongsTo('user', { async: true, inverse: 'bestFriend' }),
job: belongsTo('job', { async: false })
});
User.toString = stringify('User');

Job = DS.Model.extend({
isGood: attr(),
user: belongsTo('user', { async: false })
});
Job.toString = stringify('Job');

env = setupStore({
user: User,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@ var run = Ember.run;
var attr = DS.attr;
var belongsTo = DS.belongsTo;

function stringify(string) {
return function() { return string; };
}

module('integration/relationships/polymorphic_mixins_belongs_to_test - Polymorphic belongsTo relationships with mixins', {
beforeEach() {
User = DS.Model.extend({
name: attr('string'),
bestMessage: belongsTo('message', { async: true, polymorphic: true })
});
User.toString = stringify('User');

Message = Ember.Mixin.create({
title: attr('string'),
user: belongsTo('user', { async: true })
});
Message.toString = stringify('Message');

NotMessage = DS.Model.extend({
video: attr()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,17 @@ var attr = DS.attr;
var hasMany = DS.hasMany;
var belongsTo = DS.belongsTo;

function stringify(string) {
return function() { return string; };
}

module('integration/relationships/polymorphic_mixins_has_many_test - Polymorphic hasMany relationships with mixins', {
beforeEach() {
User = DS.Model.extend({
name: attr('string'),
messages: hasMany('message', { async: true, polymorphic: true })
});
User.toString = stringify('User');

Message = Ember.Mixin.create({
title: attr('string'),
user: belongsTo('user', { async: true })
});
Message.toString = stringify('Message');

Video = DS.Model.extend(Message, {
video: attr()
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ var Person = DS.Model.extend({

var run = Ember.run;

Person.toString = function() { return "Person"; };

var Car = DS.Model.extend({
make: DS.attr('string'),
model: DS.attr('string'),
person: DS.belongsTo('person', { async: false })
});

Car.toString = function() { return "Car"; };

function initializeStore(adapter) {
env = setupStore({
adapter: adapter
Expand Down
6 changes: 0 additions & 6 deletions tests/unit/many-array-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@ module("unit/many_array - DS.ManyArray", {
title: attr('string'),
tags: hasMany('tag', { async: false })
});
Post.toString = function() {
return 'Post';
};

Tag = DS.Model.extend({
name: attr('string'),
post: belongsTo('post', { async: false })
});
Tag.toString = function() {
return 'Tag';
};

env = setupStore({
post: Post,
Expand Down
Loading

0 comments on commit f4d3b9e

Please sign in to comment.