Skip to content

Commit

Permalink
moving person resource to test helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Fitzgerald committed Dec 29, 2011
1 parent 9840c92 commit 5935a80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 4 additions & 11 deletions test/mongo-connection-test.js
Expand Up @@ -41,11 +41,8 @@ describe("Creating", function() {
before(db.start);

it("creates a simple model", function(done){
var Person = resourceful.define('person');
Person.string('name');
Person.number('age');

Person.create({ name: 'Bob', age: 99 }, function (err, person) {

db.Person.create({ name: 'Bob', age: 99 }, function (err, person) {
if (err) { done(err); }

should.exist(person._id);
Expand All @@ -60,12 +57,8 @@ describe("Creating", function() {
describe("Updating", function() {
before(db.start);

it("paritally updates model", function(done){
var Person = resourceful.define('person');
Person.string('name');
Person.number('age');

Person.create({ name: 'Bob', age: 99 }, function (err, person) {
it("paritally updates model", function(done) {
db.Person.create({ name: 'Bob', age: 99 }, function (err, person) {
if (err) { done(err); }

person.update({name:"Steve"}, function(err, person){
Expand Down
7 changes: 6 additions & 1 deletion test/test-helper.js
Expand Up @@ -25,4 +25,9 @@ DB.products = {
"asos" : {name: 'asos jeans', brand: "test brand"},
"modcloth" : {name: 'modcloth shoes', brand: "test brand"},
"amazon" : {name: 'amazon book', brand: "pragprog"}
};
};

DB.Person = resourceful.define('person', function() {
this.string('name');
this.number('age');
});

0 comments on commit 5935a80

Please sign in to comment.