Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blockscout/test/explorer/log_test.exs

32 lines
848 B

defmodule Explorer.LogTest do
use Explorer.DataCase
alias Explorer.Log
describe "changeset/2" do
test "accepts valid attributes" do
params = params_for(:log)
changeset = Log.changeset(%Log{}, params)
assert changeset.valid?
end
test "rejects missing attributes" do
params = params_for(:log, data: nil)
changeset = Log.changeset(%Log{}, params)
refute changeset.valid?
end
test "accepts optional attributes" do
params = Map.put(params_for(:log), :first_topic, "ham")
changeset = Log.changeset(%Log{}, params)
assert changeset.valid?
end
test "assigns optional attributes" do
params = Map.put(params_for(:log), :first_topic, "ham")
changeset = Log.changeset(%Log{}, params)
assert changeset.changes.first_topic === "ham"
end
end
end