[openstreetmap/openstreetmap-website] Link GPX fixture files instead of stubbing (#1426)

Tom Hughes notifications at github.com
Sun Feb 5 17:46:34 UTC 2017

This relates to #1347 and a discussion about the best way to handle the case where we are creating a trace directly in the database using the factory and the trace model therefore expects to find the corresponding files on disk.

With the old fixtures we knew the trace IDs and simply had matching files in the repository but with factories the IDs are not predictable so @gravitystorm stubbed methods which relied on the files to refer to the copies on disk.

This alternate approach instead adds a `fixture` transient attribute to the factory that causes it to link the appropriate files from the fixture directory that is committed to the live trace directories.

I would note that several of the tests this affects were doing extremely dodgy things (that may have been inherited from the old fixture based code) like overwriting the original files and I have fixed all those as part of this.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170205/e019f0a8/attachment-0001.html>

More information about the rails-dev mailing list