-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encodes nil blobs for updates (#140)
- Loading branch information
1 parent
d8b07f6
commit 14f1f76
Showing
5 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
defmodule Ecto.Integration.BlobTest do | ||
use Ecto.Integration.Case | ||
|
||
alias Ecto.Integration.TestRepo | ||
alias EctoSQLite3.Schemas.Setting | ||
|
||
@moduletag :integration | ||
|
||
test "updates blob to nil" do | ||
setting = | ||
%Setting{} | ||
|> Setting.changeset(%{checksum: <<0x00, 0x01>>}) | ||
|> TestRepo.insert!() | ||
|
||
# Read the record back using ecto and confirm it | ||
assert %Setting{checksum: <<0x00, 0x01>>} = | ||
TestRepo.get(Setting, setting.id) | ||
|
||
assert %Setting{checksum: nil} = | ||
setting | ||
|> Setting.changeset(%{checksum: nil}) | ||
|> TestRepo.update!() | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters