#Model definition
class User < ActiveRecord::Base
validates :emal, :uniqueness => true
end
#define factory girl
Factory.sequence :email do |n|
“user_email#{n}@domain.com”
end
Factory.define :user do |user|
user.name "dongo"
user.email { Factory.next(:email) }
end
No comments:
Post a Comment