Factory Girl Matchers
Test::Unit- and RSpec-compatible one-liners that test your factories build 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
Installation
gem install factory-girl-matchers
or add the following line to Gemfile:
gem 'factory-girl-matchers'
and run bundle install
from your shell.
More Information
Copyright & License
Copyright (c) 2012 Yann Lugrin. See LICENSE for details.