Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module FixtureReplacement
- attributes_for :user do |u|
- password = String.random(6)
- u.username = "foo"
- u.password = password
- u.password_confirmation = password
- end
- attributes_for :items do |i|
- i.title = String.random
- i.user = default_user
- end
- attributes_for :scott, :class => User do |u|
- u.username => "scott"
- u.password => "scott"
- u.password_confirmation = "scott"
- end
- attributes_for :credit_card, :class => Payment::CreditCard do |credit_card|
- credit_card.expiration_date = "10/07"
- credit_card.user = default_user
- end
- end
- # This still stays the same:
- create_user
- new_user(:attribute1 => 'foo', :attribute2 => 'bar')
- # But you can also do this:
- create_scott
Add Comment
Please, Sign In to add comment