From 9085ef346598d960eb76c09a3abe8bd759264b2f Mon Sep 17 00:00:00 2001 From: Mantas Date: Thu, 1 Apr 2021 16:07:13 +0300 Subject: [PATCH] Maintenance: User factory randomizes names --- spec/factories/user.rb | 9 +++++---- spec/models/data_privacy_task_spec.rb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/factories/user.rb b/spec/factories/user.rb index 61af1d31d..029871cf5 100644 --- a/spec/factories/user.rb +++ b/spec/factories/user.rb @@ -2,12 +2,13 @@ FactoryBot.define do factory :user do transient do intro_clues { true } + slug { "#{firstname}.#{lastname}".parameterize } end - login { 'nicole.braun' } - firstname { 'Nicole' } - lastname { 'Braun' } - sequence(:email) { |n| "nicole.braun#{n}@zammad.org" } + login { slug } + firstname { Faker::Name.first_name } + lastname { Faker::Name.last_name } + sequence(:email) { |n| "#{slug}.#{n}@zammad.org" } password { nil } active { true } login_failed { 0 } diff --git a/spec/models/data_privacy_task_spec.rb b/spec/models/data_privacy_task_spec.rb index 18a19a200..ceec10b33 100644 --- a/spec/models/data_privacy_task_spec.rb +++ b/spec/models/data_privacy_task_spec.rb @@ -52,7 +52,7 @@ RSpec.describe DataPrivacyTask, type: :model do describe '#prepare_deletion_preview' do let(:organization) { create(:organization, name: 'Zammad GmbH') } - let(:user) { create(:customer, organization: organization, email: 'secret@example.com') } + let(:user) { create(:customer, firstname: 'Nicole', lastname: 'Braun', organization: organization, email: 'secret@example.com') } let(:task) { create(:data_privacy_task, deletable: user) } context 'when storing user data' do