mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 05:23:18 +12:00
15 lines
381 B
Elixir
15 lines
381 B
Elixir
defmodule AshPostgres.ConstraintTest do
|
|
@moduledoc false
|
|
use AshPostgres.RepoCase, async: false
|
|
alias AshPostgres.Test.{Api, Post}
|
|
|
|
require Ash.Query
|
|
|
|
test "constraint messages are properly raised" do
|
|
assert_raise Ash.Error.Invalid, ~r/yo, bad price/, fn ->
|
|
Post
|
|
|> Ash.Changeset.new(%{title: "title", price: -1})
|
|
|> Api.create!()
|
|
end
|
|
end
|
|
end
|