Skip to content

Commit

Permalink
update test types to match Ecto
Browse files Browse the repository at this point in the history
  • Loading branch information
mweidner037 committed Oct 14, 2024
1 parent 99e91c8 commit b464709
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions test/ecto_test/repo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Ecto.Integration.RepoTest do
# PASSES
test "supports unnamed repos" do
assert {:ok, pid} = TestRepo.start_link(name: nil)
assert Ecto.Repo.Queryable.all(pid, Post, []) == []
assert Ecto.Repo.Queryable.all(pid, Post, Ecto.Repo.Supervisor.tuplet(pid, [])) == []
end

# PASSES
Expand Down Expand Up @@ -1039,7 +1039,10 @@ defmodule Ecto.Integration.RepoTest do
}

assert {1, _} =
TestRepo.insert_all(Post, source, conflict_target: [:id], on_conflict: :replace_all)
TestRepo.insert_all(Post, source,
conflict_target: [:id],
on_conflict: :replace_all
)

expected_id = id + 1
expected_title = "A generic title suffix #{id}"
Expand Down
4 changes: 2 additions & 2 deletions test/ecto_test/type_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ defmodule Ecto.Integration.TypeTest do
end

test "uses default value" do
{_, opts} = Ecto.Repo.Registry.lookup(TestRepo)
Mongo.insert_one(opts.pid, "posts", %{title: "My Post"})
%{pid: pid} = Ecto.Repo.Registry.lookup(TestRepo)
Mongo.insert_one(pid, "posts", %{title: "My Post"})

post = TestRepo.all(Post) |> List.first()
assert post.public == true
Expand Down

0 comments on commit b464709

Please sign in to comment.