rubocop-rspec icon indicating copy to clipboard operation
rubocop-rspec copied to clipboard

Cop Idea: use fixture_path

Open mockdeep opened this issue 7 years ago • 2 comments

We've got a lot of places in our codebase where people do:

# bad
Rails.root.join('spec', 'fixtures', 'something.pdf')

It would be great to have a cop to enforce using RSpec.configuration.fixture_path:

# good
File.join(fixture_path, 'something.pdf')

mockdeep avatar Dec 10 '16 19:12 mockdeep