ash/test/resource/require_unique_action_names_test.exs

38 lines
727 B
Elixir
Raw Normal View History

defmodule Ash.Test.Resource.RequireUniqueActionNamesTest do
@moduledoc false
use ExUnit.Case, async: true
2022-04-07 17:52:59 +12:00
import Ash.Test.Helpers
test "fails if there are multiple read actions" do
assert_raise(
Spark.Error.DslError,
~r/Multiple actions \(2\) with the name `read` defined/,
fn ->
defposts do
actions do
defaults [:read]
read :read
end
end
end
)
end
test "passes if there is one default read action" do
defposts do
actions do
defaults [:read]
end
end
end
2022-04-07 17:52:59 +12:00
test "passes if there is only one defined action" do
defposts do
actions do
read :read
end
end
end
end