Skip to content

Commit

Permalink
Replace use of Faker with FFaker
Browse files Browse the repository at this point in the history
  • Loading branch information
luisramos0 committed Dec 1, 2020
1 parent f3d9781 commit 0148f9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions spec/factories.rb
@@ -1,9 +1,9 @@
require 'ffaker'

FactoryBot.define do
sequence(:random_string) { Faker::Lorem.sentence }
sequence(:random_description) { Faker::Lorem.paragraphs(Kernel.rand(1..5)).join("\n") }
sequence(:random_email) { Faker::Internet.email }
sequence(:random_string) { FFaker::Lorem.sentence }
sequence(:random_description) { FFaker::Lorem.paragraphs(Kernel.rand(1..5)).join("\n") }
sequence(:random_email) { FFaker::Internet.email }

factory :classification, class: Spree::Classification do
end
Expand Down Expand Up @@ -112,7 +112,7 @@
end

factory :customer, class: Customer do
email { Faker::Internet.email }
email { generate(:random_email) }
enterprise
code { SecureRandom.base64(150) }
user
Expand Down
8 changes: 4 additions & 4 deletions spec/factories/address_factory.rb
Expand Up @@ -20,11 +20,11 @@
end

trait :randomized do
firstname { Faker::Name.first_name }
lastname { Faker::Name.last_name }
address1 { Faker::Address.street_address }
firstname { FFaker::Name.first_name }
lastname { FFaker::Name.last_name }
address1 { FFaker::Address.street_address }
address2 nil
phone { Faker::PhoneNumber.phone_number }
phone { FFaker::PhoneNumber.phone_number }
end
end
end
2 changes: 1 addition & 1 deletion spec/models/spree/user_spec.rb
Expand Up @@ -88,7 +88,7 @@
end

context "with the the same email as existing customers" do
let(:email) { Faker::Internet.email }
let(:email) { generate(:random_email) }
let(:enterprise1) { create(:enterprise) }
let(:enterprise2) { create(:enterprise) }
let!(:customer1) { create(:customer, user: nil, email: email, enterprise: enterprise1) }
Expand Down

0 comments on commit 0148f9b

Please sign in to comment.