-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
ActiveStorage matchers #1102
Comments
I can't speak for the rest of the team, but I personally haven't used ActiveStorage yet. But if you're finding that you're using it a lot and you've worked out some matchers locally for them, and you'd be willing to be a sort of "champion" for this down the road, then we'd totally welcome the new matchers into this gem. |
Great, it's a new project and we opted in for using |
We opted in to ActiveStorage and would love this as well. |
@guialbuk What do you think if we closed this for now? I'm not sure how this would work, and considering there's still a bunch of bugfixes in the backlog to merge in first, I'm not sure if we'd be able to get to this any time soon. |
Without weighing in on whether or not adding this macro is a good idea, you can still use the has_many matcher to test ActiveStorage, given the following active record class in app/models/document.rb:
Using Minitest::Spec in test/models/document_test.rb you should still be able to do:
If you'd like to write a custom macro, open up a rails console and use this for inspiration:
Good luck! |
Hey all - I just opened a PR with activestorage to formally add validations to the library. See rails/rails#35390 The validations cover I love the shoulda-matchers library (huge thanks to everyone who has helped build it). I think it would be great to add matchers in here. If I'm lucky enough to get that merged I'll consider adding matchers here if time permits 🤞 In the meantime any support on that PR (code review, a thumbs up, etc...) would help nudge it forward too. Thanks! |
Hey folks. In an effort to lighten our load as maintainers and be able to serve you better in the future, the shoulda-matchers team is working on cleaning out the cobwebs in this repo by pruning the backlog. As there are few of us, there are a lot of items that will simply never earn our attention in a reasonable time frame, and rather than giving you an empty promise, we think it makes more sense to focus on more recent issues. That means, unfortunately, that we must close this issue. Don't take this the wrong way: our aim is not to diminish the effort people have made or dismiss problems that have been raised. If you feel that we should reopen this issue, then please let us know so that we can reprioritize it. Thanks! |
What is the consensus about adding macro matchers for the following?
has_one_attached
(from ActiveStorage Rails 5.1)has_many_attached
(from ActiveStorage Rails 5.1)The text was updated successfully, but these errors were encountered: