-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Expose a generic fixture accessor for fixture names that may conflict with Minitest #51213
Conversation
… with Minitest ```ruby assert_equal "Ruby on Rails", web_sites(:rubyonrails).name assert_equal "Ruby on Rails", fixture(:web_sites, :rubyonrails).name ``` This was brought to me by someone with a `Metadata` model. The fixtures accessor being `metadata` which conflicts with the `metadata` method recently added in `Minitest`.
e5d5228
to
ef947f9
Compare
This is clashing with class MyTest < ActiveSupport::TestCase
let(:user) { users(:alex) }
let(:fixture) { SomeFixtureObject.new }
it "passes" { assert_not_nil user }
end
A workaround would be to not ever have a |
I'd rather not because it's meant to be public API, so a leading underscore would be wrong. However what we can do:
You want to PR that? |
NB: that alias should be |
👍 can do |
Hmm, should it be showing in https://edgeapi.rubyonrails.org/classes/ActiveRecord/TestFixtures.html ? |
Yeah, it should but apparently it doesn't. Not sure how we can make a private method documented. |
I assume you'd have to make all the methods public and then |
|
This was brought to me by someone with a
Metadata
model. The fixtures accessor beingmetadata
which conflicts with themetadata
method recently added inMinitest
.cc @zk-1