Skip to content

Auto build when attribute that are declared as factories #57

@AlexO-123

Description

@AlexO-123
FakerMaker.factory :structured_address do
  buildingName { Faker::Address.building_number }
  thoroughfareName { Faker::Address.street_name }
  country { ['Wales', 'Scotland', 'Northern Ireland', 'England'].sample }
  postcode { Faker::Address.postcode }
  language { %w[EN CY].sample }
  postTown { Faker::Address.city }
end

FakerMaker.factory :user do
  name { Faker::Name.name }
  email { Faker::Internet.email }
  address { FakerMaker[:structured_address]}
end

FM[:user].build should also build the address

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions