-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ActionDispatch::TestProcess needs to access :file_fixture_path on Rails 6.1 #2385
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,12 @@ module RSpec::Rails | |
end | ||
end | ||
|
||
context 'ActionDispatch::TestProcess on Rails 6.1' do | ||
it 'can read the file_fixture_path attribute' do | ||
expect(FixtureFileUploadSupport::RailsFixtureFileWrapper).to respond_to(:file_fixture_path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This explains the how, but not the why, any chance of an integration spec for 6.1? Or do some of our existing integration specs fail on 6.1 for this reason? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Exactly, the wrapped class I'm not sure what the convention is for upcoming releases: is 6.1 running on a branch somewhere? Is it trivial for me to set that up locally? |
||
end | ||
end | ||
|
||
def fixture_file_upload_resolved(fixture_name, fixture_path = nil) | ||
RSpec::Core::ExampleGroup.describe do | ||
include RSpec::Rails::FixtureFileUploadSupport | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is only for the next version of rails, we need some kind of feature flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior versions of Rails do not access
file_fixture_path
from withinActionDispatch::TestProcess#fixture_file_upload
. Is there a benefit to not exposing the reader in those cases? Otherwise it feels a bit heavy handed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These is because the presence of this reader might be seen by other libraries feature detection and the wrong version of Rails assumed, we don't use it ourselves so theres no point having a defined reader that does nothing but might potentially false flag other libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing some context, but it doesn't feel right to me to add code to support a hypothetical edge case such as a third party library leaning on this particular class in RSpec to determine a Rails version. However, this is your project, so please feel free to merge / modify / close out this PR as you wish.