Permalink
Browse files

Fix bug in tests using faulty kin.get instead of Kin.get. Improved th…

…e tests to prevent false-positives, and removed faulty kin.get method
  • Loading branch information...
1 parent cc5177e commit 80c74ef86577e0ad76dffa0e526565b20e89788f @timoxley timoxley committed Dec 16, 2011
Showing with 7 additions and 9 deletions.
  1. +0 −4 lib/kin.js
  2. +7 −5 tests/kin_test.js
View
@@ -159,8 +159,4 @@ Kin.get = function(object, property, callback) {
}
}
-Kin.prototype.get = function(property, callback) {
- Kin.get(this, property, callback)
-}
-
module.exports = Kin
View
@@ -347,17 +347,15 @@ var tests = testCase({
callback(err, value + '@example.com')
})
},
-
})
kin.generate('User', function(err, model) {
if (err) throw err
test.equal('joe@example.com', model.email)
- test.equal('joe@example.com', model.email)
test.equal('joe@example.com@example.com', model.email2)
test.done()
})
},
- 'test can reference other function properties via `this` in blueprint function when not in order': function(test) {
+ 'test can reference other function properties via `this` in blueprint function when in order': function(test) {
kin.blueprint('User', {
_model: User,
username: function(callback) {
@@ -671,7 +669,9 @@ var tests = testCase({
callback(null, Faker.Company.catchPhrase())
},
_activities: function(callback) {
- kin.get('_id', function(err, id) {
+ Kin.get(this, '_id', function(err, id) {
+ if (err) throw err
+ test.ok(id)
kin.generate('Activity', {streamId: id}, function(err, activity) {
activities.push(activity)
callback(err, activity)
@@ -724,7 +724,9 @@ var tests = testCase({
callback(null, Faker.Company.catchPhrase())
},
_activities: function(callback) {
- kin.get('_id', function(err, id) {
+ Kin.get(this, '_id', function(err, id) {
+ if (err) throw err
+ test.ok(id)
kin.generate('Activity', {streamId: id}, function(err, activity) {
activities.push(activity)
callback(err, activity)

0 comments on commit 80c74ef

Please sign in to comment.