Permalink
Browse files

update docs

  • Loading branch information...
1 parent 31e1627 commit 6f08e9e9574f9be44e5cc1e469e9f0da8c758d8c Ryan Sonnek committed Oct 7, 2011
Showing with 18 additions and 9 deletions.
  1. +18 −9 README.md
View
@@ -4,27 +4,36 @@ Integrate FactoryGirl fixture initialization into the RSpec DSL.
## Usage
-```ruby
-# spec/factories/user_factory.rb
-Factory.define :user do |f|
- f.email 'john@acme.com'
- f.first_name "John"
- f.last_name "Doe"
- f.phone_number '555.5555'
+Basic usage
+```ruby
+# spec/models/user_spec.rb
+describe User do
+ context 'basic user' do
+ # instantiate FactoryGirl :user fixture
+ with :user
+ it { user.should be_inactive }
+ it { user.should_not be_happy }
+ end
end
```
+Advanced usage
```ruby
# spec/models/user_spec.rb
describe User do
- context 'basic user' do
- with :user
+ context 'when user.first_name == nil' do
+ # instantiate FactoryGirl :user fixture with custom options
+ with :user, :first_name => nil
it { user.should be_inactive }
it { user.should_not be_happy }
end
end
```
+## Features
+* clean and concise DSL for instantiating FactoryGirl fixtures
+* easily configure deviations in fixtures with optional parameter hash
+
## Installation
```ruby

0 comments on commit 6f08e9e

Please sign in to comment.