Closed yanghoxom closed 8 months ago
@yanghoxom Look at this issue #1052. Last comments will help you. This issue not related to shoulda. It is related to ActiveRecord *_type reserved methods for STI as I remember.
Thank you, @skalibog, for finding that issue and adding here.
Hey, @yanghoxom, I'm planning to close this issue since it doesn't appear to be related to this project. However, if you believe the problem still lies within sholda-matchers, we can reopen it. Thanks for your understanding.
@skalibog the proposed workarounds does not really solves anything; or maybe i'm missing the point
Tried to disable sti on the given model, used described_class.new and factory to instantiate the subject; the very same error remains
Hey, @benbonnet, thanks for the report!
Would you mind replicating the issue in a minimal Rails application? It would greatly assist us in troubleshooting.
Thanks again.
my bad reviewing the factory and correctly defining it before the assertion made it all pass
Behavior
I think shoulda matchers try to create tests with random value for a_type which should cause
wrong constant name
error I tried removing a_type from scope, everything works fine.Gem
Ruby 3.1.3 Rails 7.0.4 shoulda-matchers (5.3.0)
Model
rspec ###
Rspec result
Backtrace