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

Fix specs on Rails master/6.1.0.alpha #3614

Conversation

filippoliverani
Copy link
Contributor

@filippoliverani filippoliverani commented May 8, 2020

Description

Search::Base specs started to fail because ActiveRecord-generated SQL has changed in Rails master/6.1.0.alpha.
Generated SQL is bound to change and should not be used in expectations. Search results expectations now verify actual search output only.
When filtering on ranges between Arel operator must be used.
in operator implementation isn't converted anymore in a between SQL query, it
was a deprecated optimization now removed in rails/rails#39163

Spree::Api::ImagesController request specs started to fail because ActionDispatch::TestProcess::FixtureFile#fixture_file_upload has been changed in Rails master/6.1.0.alpha and rspec-rails is not compatible anymore with it.
Rack::Test::UploadedFile handles our use-case in the same away and doesn't have any compatibility issues.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • [ ] I have updated Guides and README accordingly to this change (if needed)
  • [ ] I have added tests to cover this change (if needed)
  • [ ] I have attached screenshots to this PR for visual changes (if needed)

@filippoliverani filippoliverani changed the title Fix Search::Base specs on Rails master/6.1.0.alpha Specs on Rails master/6.1.0.alpha May 8, 2020
@filippoliverani filippoliverani changed the title Specs on Rails master/6.1.0.alpha Fix specs on Rails master/6.1.0.alpha May 8, 2020
@jarednorman
Copy link
Member

Nice. I see this is still failing the Rails master build, but I like the approach.

ActiveRecord-genereated SQL is bound to change and should not be used in
expectations. Search results expectations now verify actual search
output only.
rspec-rails is not yet compatible with latest versions of
ActionDispatch::TestProcess::FixtureFile and raises an error while
interacting with it.
Rack::Test::UploadedFile handles our use-case in the same away and
doesn't have any compatbility issues.
@filippoliverani filippoliverani force-pushed the filippoliverani/fix-specs-against-rails-master branch from 6cc19b4 to 508e320 Compare May 9, 2020 14:37
When filtering on ranges `between` Arel operator must be used.
`in` operator implementation isn't converted anymore in a between query, it
was a deperecated optimization now removed in rails/rails#39163
@filippoliverani filippoliverani force-pushed the filippoliverani/fix-specs-against-rails-master branch from 662f4fc to 9c14a50 Compare May 10, 2020 11:46
@filippoliverani
Copy link
Contributor Author

filippoliverani commented May 10, 2020

Nice. I see this is still failing the Rails master build, but I like the approach.

Thank you @jarednorman , almost there!

@filippoliverani filippoliverani marked this pull request as ready for review May 10, 2020 12:26
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Filippo!

@aldesantis
Copy link
Member

Thanks @filippoliverani!

@aldesantis aldesantis merged commit 8b72292 into solidusio:master May 11, 2020
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.

4 participants