balderdashy / waterline-adapter-tests

API integration tests for Waterline adapters
MIT License
16 stars 41 forks source link

Data Types Testing Issue #66

Closed khalilTN closed 9 years ago

khalilTN commented 9 years ago

The tests of data types (semantic/types) use the values returned from a .create() call, .create() retrieved only auto incremented ids from the table so the values returned in callback will be the same values passed as parameters, that's why the test should insert, and then query the table to retrieve the persistent value.

devinivy commented 9 years ago

Looks good– thanks! :+1:

khalilTN commented 9 years ago

You are welcome ! ;)

dmarcelino commented 9 years ago

@khalilTN, @atiertant, this does look good indeed! This has exposed an apparent bug in sails-mongo since it is breaking the test:

build log line 536: https://travis-ci.org/balderdashy/waterline-adapter-tests/jobs/61589255#L536

We'll need to fix that before we can merge this to avoid breaking the build. I've raised balderdashy/sails-mongo#272 to address the sails-mongo issue.

atiertant commented 9 years ago

@dmarcelino there is no better demonstation about this tests are useful...

dmarcelino commented 9 years ago

Indeed! :smiley:

@khalilTN, @atiertant, it just occurred to me that this change make us lose the verification of the values returned by .create(). Can we also add checks to those, like:

  assert.equal(createdRecord.list.length, 4);
dmarcelino commented 9 years ago

I've submitted PR balderdashy/sails-mongo#274 which fixes balderdashy/sails-mongo#272, feel free to review it! :wink:

khalilTN commented 9 years ago

I have commited the tests for the record returned by .create().

dmarcelino commented 9 years ago

Perfect @khalilTN! Thank you.