I’m using fixtures and I’m running a test where I need to access a URL of a file from a certain person. I don’t want to go over the internet to fetch this everytime so I have downloaded the file and put it in my test directory "/test/sample/somefile.html".
How do I write the local path in my fixture file so I can access file_path within my test.
#BEFORE
three:
id: 3
user: Joey
file_path: http://www.google.com/somefile.html
last_modified:
#AFTER
three:
id: 3
user: Joey
file_path: <%= "./test/sample/somefile.html" %>
last_modified:
Do:
Or use
RAILS_ROOTif you have an old version of Rails.