vanderleipinto / test_app

0 stars 0 forks source link

feat: sequence #24

Closed vanderleipinto closed 7 months ago

vanderleipinto commented 7 months ago

Criando a sequence no factory

sequence(:email, 'January') {|n| "meu_email-#{n}@email.com"}

Usando a sequence no customer_rspec.rb


  it 'Creates email using sequence' do
    #in the factory the email sequence works like this:
    # sequence(:email) {|n| "customer_email-#{n}@email.com"}
    customer = create(:customer_female_default)
    customer2 = create(:customer_male_default)
    puts customer.email
    puts customer2.email
  end