123456789_123456789_123456789_123456789_123456789_

Module: RSpec::Rails::FixtureFileUploadSupport Private

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Defined in: rspec-rails/lib/rspec/rails/fixture_file_upload_support.rb

Instance Attribute Summary

Instance Method Summary

  • #rails_fixture_file_wrapper private Internal use only

    In Rails 7.0 fixture file path needs to be relative to file_fixture_path instead, this change was brought in with a deprecation warning on 6.1.

Instance Attribute Details

#fixture_file_upload (readonly)

[ GitHub ]

  
# File 'rspec-rails/lib/rspec/rails/fixture_file_upload_support.rb', line 5

delegate :fixture_file_upload, to: :rails_fixture_file_wrapper

Instance Method Details

#rails_fixture_file_wrapper (private)

In Rails 7.0 fixture file path needs to be relative to file_fixture_path instead, this change was brought in with a deprecation warning on 6.1. In Rails 7.0 expect to rework this to remove the old accessor.

[ GitHub ]

  
# File 'rspec-rails/lib/rspec/rails/fixture_file_upload_support.rb', line 12

def rails_fixture_file_wrapper
  RailsFixtureFileWrapper.file_fixture_path = nil
  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
    else
      (RSpec.configuration.fixture_path || '').to_s
    end
  RailsFixtureFileWrapper.file_fixture_path = File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
  RailsFixtureFileWrapper.instance
end