Overriding attributes

You can also override attributes on associations.

Implicitly:

factory :post do
  # ...
  author factory: :author, last_name: "Writely"
end

Explicitly:

factory :post do
  # ...
  association :author, last_name: "Writely"
end

Or inline using attributes from the factory:

factory :post do
  # ...
  author_last_name { "Writely" }
  author { association :author, last_name: author_last_name }
end