balderdashy / waterline-adapter-tests

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

Semantic Interface .find() should return a model instance #95

Closed sajov closed 8 years ago

sajov commented 8 years ago

what should an Adapter return in find method? My adapter return an Array and test failed. a look into other adapters does not makes that clear to me.

thanks

devinivy commented 8 years ago

Which assertion here is failing? https://github.com/balderdashy/waterline-adapter-tests/blob/8888db4bb22c4528258cf11dd6092763718564f5/interfaces/semantic/find.test.js#L62-L71

sajov commented 8 years ago

sorry, yes exactly this one.
assert.equal(typeof user.fullName, 'function'); how that can be? does waterline wrap a result of one document as a model instance?

thanks

devinivy commented 8 years ago

Yes, this is odd. Wrapping the document in a model instance is something waterline should take care of. Does your results list otherwise look correct if you log/inspect it? Does your adapter modify the waterline collection definition in any way? If the source of your adapter is on the web, I'd be happy to take a look.

sajov commented 8 years ago

ok, i will inspect the result. At the moment only 50% over all test passing. I will publish sails-solr in a few days. It would be great if you can have a look into that.

devinivy commented 8 years ago

@sajov did you have any luck? What was the issue?

sajov commented 8 years ago

@devinivy yes, it was my fault. The Adapter did not handle solr response correct

jpventura commented 7 years ago

@sajov what was missing in your adapter handler? I am having the same problem with my adapter

mikermcneil commented 7 years ago

@sajov I'm also curious (I know it's been a while though!)

btw I went through the adapter list for the sails website this weekend, and I believe sails-solr was one of the ones I updated the info for. So should actually link to the right place now 👍 . Also, there are some changes to adapters for Sails v1 I'd like to get you up to speed on. Would you hit me up whenever you have some time? (http://twitter.com/mikermcneil)