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

Improve where filter tests #1472

Merged
merged 5 commits into from
Sep 16, 2021

Conversation

andershagbard
Copy link
Contributor

@andershagbard andershagbard commented Sep 13, 2021

This makes sure a feature (Which may be caused by a bug) is tested. I've seen this used in a few themes.

This is mainly used on tags within Shopify.

assign tags = product.tags | where: 'some_prefix:'

This will get all tags containing some_prefix:.

Copy link
Contributor

@macournoyer macournoyer left a comment

Choose a reason for hiding this comment

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

Oh wow! This works because "beta"["be"] returns a truthy value in Ruby.

But make sense to add a test since it's used in some themes 👍

Copy link
Contributor

@dylanahsmith dylanahsmith left a comment

Choose a reason for hiding this comment

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

Thank you very much for this test. I could definitely see how not having this test could result in a regression from someone changing liquid without considering String#[] being leveraged in this way for the where filter.

History.md Outdated Show resolved Hide resolved
@dylanahsmith dylanahsmith merged commit db3999a into Shopify:master Sep 16, 2021
@andershagbard andershagbard deleted the where-feature-test branch September 16, 2021 16:09
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.

None yet

3 participants