How do you define trait using Fabrication

Viewed 734

I am learning how to use fabrication in Rails and we have decided to replace all our factory_girl code with fabrication.

Suppose we have this code in factory_girl

FactoryGirl.define do
  factory :user do
  trait(:no_credits) { credits 0 }
  trait(:with_credits) { credits 300 }

How will you define this in Fabrication? I have gone through their website but couldn't find anything regarding this. Will appreciate your help

1 Answers
Related