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

Translating to "match" instead of "match_array" for ActiveRecord relation #92

Closed
KurtPreston opened this issue Sep 26, 2014 · 1 comment

Comments

@KurtPreston
Copy link

Hey, great work with this! I've tried it against two projects and it worked almost flawlessly. I did encounter one error with the following line of code:

widgets.should =~ Widget.where('created_at > (?)', @time1 - 1.day).where('created_at < (?)', @time1 + 1.day)

This was erroneously translated to:

expect(widgets).to match(Widget.where('created_at > (?)', @time1 - 1.day).where('created_at < (?)', @time1 + 1.day))

However, this spec fails. I believe it should have used match_array instead of match. The following line works:

expect(widgets).to match_array(Widget.where('created_at > (?)', @time1 - 1.day).where('created_at < (?)', @time1 + 1.day))
@yujinakayama
Copy link
Owner

Thanks for the report, and sorry for this late response 😉

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