← Back to Upcase

Person = Person.new(...)

(Toby Woller) #1

When creating a new instance of person for a test is it a best practice to just lowercase the class name?

person = Person.new(…)

Reading through most submissions it seems that is what everyone is doing.

(Andy Waite) #2

I would aim to give a more descriptive name where possible, e.g. person_with_missing_surname, person_with_active_subscription, etc. It gives more context when reading the tests.

2 Likes
(Catherine Cai) #3

+1 to this.

It’s even easier when you use FactoryGirl and you’re able to use traits.