[openstreetmap/openstreetmap-website] Add Factorygirl as an alternative to fixtures (#1279)
notifications at github.com
Wed Sep 7 15:33:45 UTC 2016
FactoryGirl is a widely used alternative to fixtures in tests. The fixtures are annoying since every time you want to test something slightly different (for example, a diary entry with an apostrophe in its title), you need to add a whole new fixture and rework the tests. Fixtures are also a pain when the model attributes change.
This PR adds FactoryGirl, and reworks two model tests (DiaryEntry and DiaryComment) to use them.
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* Add FactoryGirl
* Rework DiaryEntry and DiaryComment model tests to use factories.
-- File Changes --
M Gemfile (1)
M Gemfile.lock (6)
A test/factories/diary_comments.rb (10)
A test/factories/diary_entries.rb (9)
M test/models/diary_comment_test.rb (6)
M test/models/diary_entry_test.rb (27)
M test/test_helper.rb (2)
-- Patch Links --
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...
More information about the rails-dev