Skip to content

Commit 21aaa74

Browse files
committed
Adds test for UUID handling
fixes #96
1 parent 5bf3a65 commit 21aaa74

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
defmodule Ecto.Integration.UUIDTest do
2+
use Ecto.Integration.Case
3+
4+
alias Ecto.Integration.TestRepo
5+
alias Exqlite.Integration.Product
6+
7+
test "handles uuid serialization and deserialization" do
8+
external_id = Ecto.UUID.generate()
9+
product = TestRepo.insert!(%Product{name: "Pupper Beer", external_id: external_id})
10+
11+
assert product.id
12+
assert product.external_id == external_id
13+
14+
found = TestRepo.get(Product, product.id)
15+
assert found
16+
assert found.external_id == external_id
17+
end
18+
end

0 commit comments

Comments
 (0)