Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add hasAndBelongsToMany integration test #220

Merged
merged 1 commit into from
Mar 25, 2014

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Mar 25, 2014

This pull request adds two integration tests for loopbackio/loopback-datasource-juggler#85

  • it allows to find related objects via id filter

    GET /api/products?filter[where][categoryId]=CAT-ID

  • it fills related objects requested by "include" in find

    GET /api/categories/findOne?filter[where][id]=CAT-ID&filter[include]=products

What is not covered yet:

  • it fills related objects requested by "include" in findById

    GET /api/categories/CAT-ID?include=products

/to @raymondfeng please review.
/cc @ritch @pandaiolo

Related: strongloop/loopback-sdk-angular#26

@raymondfeng
Copy link
Member

The findById issue seems to be bug. What DB do you test against?

@bajtos
Copy link
Member Author

bajtos commented Mar 25, 2014

@raymondfeng memory db

@bajtos
Copy link
Member Author

bajtos commented Mar 25, 2014

I have updated the find + include URL in the commit & the pr description, it should be

GET /api/products?filter[where][categoryId]=CAT-ID

@slnode
Copy link

slnode commented Mar 25, 2014

All is well
Refer to this link for build results: http://ci.strongloop.com/job/loopback/1033/

@slnode
Copy link

slnode commented Mar 25, 2014

Test Failed. To trigger a build add comment - ".test\W+please"
Refer to this link for build results: http://ci.strongloop.com/job/loopback/1034/

* it allows to find related object via URL scope
  GET /api/categories/{cat-id}/products

* it allows to find related objects via where filter
  GET /api/products?filter[where][categoryId]={cat-id}
  (skipped for now)

* it includes requested related models in `find`
  GET /api/categories/findOne
      ?filter[where][id]=CAT-ID&filter[include]=products

* it includes requested related models in `findById`
  GET /api/categories/{cat-id}?include=products
  (skipped for now)
@bajtos
Copy link
Member Author

bajtos commented Mar 25, 2014

I have reworked the tests, two of them are marked as "skip" since the functionality is not implemented yet.

  • it allows to find related object via URL scope
    GET /api/categories/{cat-id}/products
  • it allows to find related objects via where filter
    GET /api/products?filter[where][categoryId]={cat-id}
    (skipped for now)
  • it includes requested related models in find
    GET /api/categories/findOne?filter[where][id]=CAT-ID&filter[include]=products
  • it includes requested related models in findById
    GET /api/categories/{cat-id}?include=products
    (skipped for now)

@raymondfeng the patch is ready for review now.

@raymondfeng
Copy link
Member

LGTM.

bajtos added a commit that referenced this pull request Mar 25, 2014
…hasManyThrough

test: add hasAndBelongsToMany integration test
@bajtos bajtos merged commit 6adb6ca into master Mar 25, 2014
@bajtos bajtos deleted the feature/add-test-for-include-hasManyThrough branch March 25, 2014 18:53
@slnode
Copy link

slnode commented Mar 25, 2014

All is well
Refer to this link for build results: http://ci.strongloop.com/job/loopback/1036/

@slnode
Copy link

slnode commented Mar 25, 2014

Test Failed. To trigger a build add comment - ".test\W+please"
Refer to this link for build results: http://ci.strongloop.com/job/loopback/1038/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants