mirror of
https://github.com/thoughtbot/factory_bot_rails.git
synced 2022-11-09 11:49:18 -05:00
Improve documentation around the fixture_replacement generator
This commit is contained in:
parent
f4bd6ace48
commit
2ab0ea4141
1 changed files with 8 additions and 10 deletions
18
README.md
18
README.md
|
@ -1,16 +1,16 @@
|
||||||
factory_girl [![Build Status](https://secure.travis-ci.org/thoughtbot/factory_girl_rails.png)](http://travis-ci.org/thoughtbot/factory_girl_rails?branch=master)
|
factory_girl [![Build Status](https://secure.travis-ci.org/thoughtbot/factory_girl_rails.png)](http://travis-ci.org/thoughtbot/factory_girl_rails?branch=master)
|
||||||
============
|
============
|
||||||
|
|
||||||
factory_girl is a fixtures replacement with a straightforward definition
|
`factory_girl` is a fixtures replacement with a straightforward definition
|
||||||
syntax, support for multiple build strategies (saved instances, unsaved
|
syntax, support for multiple build strategies (saved instances, unsaved
|
||||||
instances, attribute hashes, and stubbed objects), and support for multiple
|
instances, attribute hashes, and stubbed objects), and support for multiple
|
||||||
factories for the same class (user, admin_user, and so on), including factory
|
factories for the same class (`user`, `admin_user`, and so on), including factory
|
||||||
inheritance.
|
inheritance.
|
||||||
|
|
||||||
Rails
|
Rails
|
||||||
-----
|
-----
|
||||||
|
|
||||||
factory_girl_rails provides Rails integration for factory_girl. All
|
`factory_girl_rails` provides Rails integration for `factory_girl`. All
|
||||||
Rails-specific features are only compatible with Rails 3.
|
Rails-specific features are only compatible with Rails 3.
|
||||||
|
|
||||||
Currently, automatic factory definition loading is the only Rails-specific feature.
|
Currently, automatic factory definition loading is the only Rails-specific feature.
|
||||||
|
@ -27,7 +27,7 @@ Gem:
|
||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Add factory_girl_rails to your Gemfile:
|
Add `factory_girl_rails` to your Gemfile:
|
||||||
|
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_girl_rails'
|
||||||
|
|
||||||
|
@ -38,15 +38,13 @@ of fixtures, add the following to your application.rb file:
|
||||||
g.fixture_replacement :factory_girl
|
g.fixture_replacement :factory_girl
|
||||||
end
|
end
|
||||||
|
|
||||||
|
If you use `factory_girl` for fixture replacement, ensure that
|
||||||
|
`factory_girl_rails` is available in the development group. If it's not, Rails
|
||||||
|
will generate standard yml files instead of factory files.
|
||||||
|
|
||||||
`fixture_replacement :factory_girl` takes an option `:suffix => 'some_suffix'`
|
`fixture_replacement :factory_girl` takes an option `:suffix => 'some_suffix'`
|
||||||
to generate factories as "modelname_some_suffix.rb"
|
to generate factories as "modelname_some_suffix.rb"
|
||||||
|
|
||||||
Cucumber Integration
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
factory_girl ships with step definitions for Cucumber integration. For more information, see the GETTING_STARTED file in the factory_girl repo.
|
|
||||||
|
|
||||||
|
|
||||||
More Information
|
More Information
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue