FLOOR MANAGER - when your job is handling the girls The floor manager manages a whole graph of objects and lets you create them in memory or the database for the duration of a test. You need two posts that are linked up to the same author? [1] Easy: FloorManager.define :first do one :author do name 'John Smith' end any :post do title 'The posts title' author.set :author end end And in your tests: before(:each) do FloorManager.reset floor = FloorManager.get(:floor) posts = [floor.create(:post), floor.create(:post)] end This gives you two posts to test against. Both posts will have the same author, right down to the database id. Look here for more documentation: http://blog.absurd.li/2011/09/28/introducing_floor_manager.html INSTALLATION Either by installing from http://github.com/kschiess/floor_manager as a rails plugin or by using rubygems: gem install floor_manager Then just require it atop of your floor definitions as follows: require 'floor_manager' # Your floors go here... COMPATIBILITY Has been tested with Ruby 1.9.2/1.8.7 MRI and ActiveRecord/DataMapper. STATUS Useful in daily life. AUTHOR Kaspar Schiess (kaspar.schiess@absurd.li) [1] http://robots.thoughtbot.com/post/159807023/waiting-for-a-factory-girl
Project
floor_manager
Allows creation of a whole graph of objects on the fly during testing
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Development
Dependencies
Runtime
~> 2.1.2.4
Project Readme