Skip to content

Commit cb09b20

Browse files
committed
Can create as many Authorization Requests as wanted in development
Previously, unicity condition on email and external_id was preventing from creating more ARs in development this is a bit ugly but more practical.
1 parent f530956 commit cb09b20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/factories/users.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FactoryBot.define do
2-
sequence(:email) { |n| "user#{n}@gouv.fr" }
3-
sequence(:external_id) { |n| (n + 100).to_s }
2+
sequence(:email) { |n| "user#{User.count + n}@gouv.fr" }
3+
sequence(:external_id) { |n| (n + User.maximum('CAST(external_id AS INTEGER)').to_i).to_s }
44

55
factory :user do
66
email

0 commit comments

Comments
 (0)