Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Allows creation of a whole graph of objects on the fly during testing

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 HISTORY.txt
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 floor_manager.gemspec
README
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
Something went wrong with that request. Please try again.