test: add tests for Server model

This commit is contained in:
Adam Cooke
2024-02-23 22:51:34 +00:00
committed by Adam Cooke
parent 8b61100082
commit 2023200d91
19 changed files with 707 additions and 64 deletions
+15
View File
@@ -0,0 +1,15 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ip_pool_rule do
owner factory: :organization
ip_pool
to_text { "google.com" }
after(:build) do |ip_pool_rule|
if ip_pool_rule.ip_pool.organizations.empty? && ip_pool_rule.owner.is_a?(Organization)
ip_pool_rule.ip_pool.organizations << ip_pool_rule.owner
end
end
end
end