We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd7cd99 commit f8f2b6aCopy full SHA for f8f2b6a
1 file changed
test/ecto_integration_test.exs
@@ -947,14 +947,16 @@ defmodule Ecto.Integration.EctoLibSqlTest do
947
conflict_target: :email
948
)
949
950
- {:ok, updated} =
+ {:ok, _updated} =
951
TestRepo.insert(%User{name: "Alice Updated", email: "alice@example.com"},
952
on_conflict: :replace_all,
953
954
955
956
- # The email is the conflict target - name should reflect the upserted value.
957
- assert updated.email == "alice@example.com"
+ # Fetch from the DB to confirm the change was actually persisted, not just
+ # reflected in the returned struct.
958
+ reloaded = TestRepo.get_by!(User, email: "alice@example.com")
959
+ assert reloaded.name == "Alice Updated"
960
assert TestRepo.aggregate(User, :count, :id) == 1
961
end
962
0 commit comments