require 'faker' FactoryGirl.define do factory :comment do sequence(:content){ |n| "This is comment content#{n}"} factory :comment_content_nil do content nil end factory :comment_content_allspace do content " " end end end