Skip to content

Conversation

todtb
Copy link

@todtb todtb commented Jul 22, 2021

This may or may not be useful to the larger community, but here they are if interested. Love to hear any feedback either way.

These matchers are a suplement to the existing schema specs. The schema (by necessity) cannot assert against specific adapter dependent options (PK, FK, etc), however when using with AR (or otherwise passing such options) this helps assert those are maintained.

# example:
expect(subject).to belong_to_resource(:userr).with_options(foreign_key: :user_id, resource: User)
       expected that PostResource would belong to user
       expected that foreign_key would be user_id, was user_idd
       expected that resource would be UserResource, was UsrRsource

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.

1 participant