-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Support file_fixture
in Factory definitions
#427
base: main
Are you sure you want to change the base?
Conversation
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.
I would test an actual file upload if possible. Otherwise looks good to me
This is our first time extending I can't think of how this could break existing tests but maybe I'm just not being creative enough. |
8a739aa
to
5a1a15e
Compare
0cd66df
to
33c1348
Compare
33c1348
to
61baf5f
Compare
611f31f
to
f878964
Compare
Related to [factory_bot#1282][] [rails/rails#45606][] has been merged and is likely to be released as part of Rails 7.1. With that addition, the path toward resolving [factory_bot#1282][] becomes more clear. If factories can pass along [Pathname][] instances to attachment attributes, Active Support will handle the rest. Instances of `ActiveSupport::TestCase` provide a [file_fixture][] helper to construct a `Pathname` instance based on the path defined by `ActiveSupport::TestCase.file_fixture_path` (relative to the Rails root directory). [factory_bot#1282]: thoughtbot/factory_bot#1282 (comment) [rails/rails#45606]: rails/rails#45606 [Pathname]: https://docs.ruby-lang.org/en/master/Pathname.html [file_fixture]: https://api.rubyonrails.org/classes/ActiveSupport/Testing/FileFixtures.html#method-i-file_fixture
f878964
to
43e18b9
Compare
Related to factory_bot#1282
rails/rails#45606 has been merged and is likely to be released as part of Rails 7.1.
With that addition, the path toward resolving factory_bot#1282 becomes more clear. If factories can pass along Pathname instances to attachment attributes, Active Support will handle the rest.
Instances of
ActiveSupport::TestCase
provide a file_fixture helper to construct aPathname
instance based on the path defined byActiveSupport::TestCase.file_fixture_path
(relative to the Rails root directory).