RSpec::FileFixtures provides convenient and consistent access to fixture data in RSpec.
Add the following to your Gemfile
in your :test
group:
gem 'rspec-file_fixtures', '~> 0.1.6'
Enable the RSpec extension is your spec helper:
# spec/spec_helper.rb
require 'rspec/file_fixtures'
Use the provided fixture
helper anywhere in your tests to load content from spec/fixtures/
:
See the Usage section for available extensions.