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

[Spree 2.1] Caching #5486

Merged
merged 4 commits into from
May 22, 2020
Merged

Conversation

Matt-Yorkley
Copy link
Contributor

What? Why?

Closes #5462

There were some changes in Rails 4 to both caching in views, and apparently to the way Rspec mocks work in tests. See commit messages for further info.

What should we test?

Green specs!

Mocking these objects is working differently in Rails 4, and utilising `#and_call_original` helped to ensure different parts of the codebase were receiving the correct response objects (AR relations, etc).
Rails 4 introduced "automagically" modified cache keys, that included a digest in the key on any cache entry related to views. This is not what we want at all, fixed here with the `skip_digest: true` option.
@Matt-Yorkley Matt-Yorkley self-assigned this May 22, 2020
Rails 4 has slightly changed the format of the cache keys here, so the response was not as expected.
@Matt-Yorkley
Copy link
Contributor Author

All caching specs are green ✔️

@sauloperez
Copy link
Contributor

Taking the shortcut and merging in.

@sauloperez sauloperez merged commit ff0e85c into openfoodfoundation:3-0-stable May 22, 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.

2 participants