Rspec matcher collection for testing your model builded with factory girl.
Pull request Compare This branch is 1 commit ahead, 17 commits behind yannlugrin:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/spec
spec
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION.yml
init.rb
rspec-factory-girl.gemspec

README.rdoc

RSpec - Factory Girl

RSpec matcher collection for testing your model built with factory girl.

describe Post do
  it { should be_built_by_factory } # Factory named ':post' is used
  it { should be_created_by_factory } # Factory named ':post' is used

  it { should be_built_by_factory(:my_factory) }
  it { should be_created_by_factory(:my_factory) }
end

Install

Run the following if you haven't already:

gem sources -a http://gems.github.com

Install the gem:

sudo gem install yannlugrin-rspec-factory-girl

Installing via Rails

Specify the gem dependency in your config/environment.rb file after 'spec/rails' dependency:

config.gem "yannlugrin-rspec-factory-girl", :lib => "rspec/factory_girl", :source => "http://gems.github.com"

Then run in terminal:

$ rake gems:install

As a Plugin

You can also install Remarkable as a plugin:

$ script/plugin install git://github.com/yannlugrin/rspec-factory-girl.git

Or using git submodules:

$ git submodule add git://github.com/yannlugrin/rspec-factory-girl.git vendor/plugins/rspec-factory-girl

Requirements

  • factory_girl >= 1.2.0

  • rspec >= 1.2.0

  • rspec-rails >= 1.2.0 (only for rails projects)

More information

Github: www.github.com/yannlugrin/rspec-factory-girl Bug tracking: yannlugrin.lighthouseapp.com/projects/27537-rspec-factory-girl/overview

Copyright & License

Copyright © 2009 Yann Lugrin. See LICENSE for details.