restrict user invites

This commit is contained in:
Alex Turchyn
2024-12-10 23:18:07 +02:00
committed by Pete Matsyburka
parent b317094192
commit b6a2aae970
5 changed files with 67 additions and 15 deletions
+15
View File
@@ -6,6 +6,10 @@ FactoryBot.define do
locale { 'en-US' }
timezone { 'UTC' }
transient do
teams_count { 2 }
end
trait :with_testing_account do
after(:create) do |account|
testing_account = account.dup.tap { |a| a.name = "Testing - #{account.name}" }
@@ -14,5 +18,16 @@ FactoryBot.define do
account.save!
end
end
trait :with_teams do
after(:create) do |account, evaluator|
Array.new(evaluator.teams_count) do |i|
Account.create!(
name: "Team #{i}",
linked_account_account: AccountLinkedAccount.new(account_type: :linked, account:)
)
end
end
end
end
end