Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 25, 2023

  1. Support file_fixture in Factory definitions

    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
    seanpdoyle committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    8a739aa View commit details
    Browse the repository at this point in the history