add integrations test fixture
This commit is contained in:
parent
9ab0380c87
commit
9f3eb55476
1 changed files with 19 additions and 0 deletions
19
test/support/fixtures/integrations_fixtures.ex
Normal file
19
test/support/fixtures/integrations_fixtures.ex
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
defmodule Towerops.IntegrationsFixtures do
|
||||
@moduledoc """
|
||||
Test helpers for creating integration entities.
|
||||
"""
|
||||
|
||||
alias Towerops.Integrations
|
||||
|
||||
def integration_fixture(organization_id, attrs \\ %{}) do
|
||||
attrs =
|
||||
Enum.into(attrs, %{
|
||||
provider: "preseem",
|
||||
enabled: true,
|
||||
credentials: %{"api_key" => "test-key-#{System.unique_integer()}"}
|
||||
})
|
||||
|
||||
{:ok, integration} = Integrations.create_integration(organization_id, attrs)
|
||||
integration
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue