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

have_db_column refactor from #1358 broke tests #1414

Closed
lifeiscontent opened this issue Feb 12, 2021 · 4 comments
Closed

have_db_column refactor from #1358 broke tests #1414

lifeiscontent opened this issue Feb 12, 2021 · 4 comments

Comments

@lifeiscontent
Copy link

I have a test:

it { is_expected.to have_db_column(:author_id).with_options(null: false, foreign_key: { to_table: :users }) }

which is now not possible due to the refactor of #1358 because it doesn't have foreign_key in its list of options.

@lifeiscontent lifeiscontent changed the title #1358 broke tests have_db_column refactor from #1358 broke tests Feb 12, 2021
@lifeiscontent
Copy link
Author

CC: @rodriggochaves @mcmire

@lifeiscontent
Copy link
Author

example usage here: lifeiscontent/realworld#662

@mcmire
Copy link
Collaborator

mcmire commented Feb 23, 2021

@lifeiscontent Sorry that this broke your test. That said, we have never officially supported checking for foreign_key so far, so prior to 4.5.0 your test was equivalent to:

it { is_expected.to have_db_column(:author_id).with_options(null: false) }

We will happily take a PR to add this as a feature though.

@mcmire
Copy link
Collaborator

mcmire commented Mar 23, 2021

Closing this since #1421 was closed.

@mcmire mcmire closed this as completed Mar 23, 2021
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

No branches or pull requests

2 participants