-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add fixture_paths configuration setting #2673
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
Changes from all commits
f1afa0c
b64a9a4
7c5b35e
9d32316
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 |
---|---|---|
|
@@ -14,6 +14,8 @@ def rails_fixture_file_wrapper | |
resolved_fixture_path = | ||
if respond_to?(:file_fixture_path) && !file_fixture_path.nil? | ||
file_fixture_path.to_s | ||
elsif respond_to?(:fixture_paths) | ||
(RSpec.configuration.fixture_paths&.first || '').to_s | ||
Comment on lines
+17
to
+18
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. Is it possible that 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. I don't think so. This module is included in But it could be set to 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. Does Rails not support multiple paths here? Seems odd they would allow multiple paths for fixtures but not for files? 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. It is weird indeed, but I could not find any reference to a plural method in their codebase. Here the author of the change mentions that it is something that they might wanna do in the future. 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. Does Rails solely configure this with file_fixture_path directly? 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. I think so: https://github.com/search?q=repo%3Arails%2Frails%20file_fixture_path&type=code It defaults to |
||
else | ||
(RSpec.configuration.fixture_path || '').to_s | ||
end | ||
|
@@ -26,7 +28,11 @@ class RailsFixtureFileWrapper | |
include ActiveSupport::Testing::FileFixtures | ||
|
||
class << self | ||
attr_accessor :fixture_path | ||
if ::Rails::VERSION::STRING < "7.1.0" | ||
attr_accessor :fixture_path | ||
else | ||
attr_accessor :fixture_paths | ||
end | ||
|
||
# Get instance of wrapper | ||
def instance | ||
|
Uh oh!
There was an error while loading. Please reload this page.