fix more tests

pull/2834/head
Ayrat Badykov 5 years ago
parent 859d2e9fa5
commit 2e46a3905e
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 3
      apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs
  2. 6
      apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs

@ -3,6 +3,7 @@ defmodule BlockScoutWeb.AddressControllerTest do
# ETS tables are shared in `Explorer.Counters.*` # ETS tables are shared in `Explorer.Counters.*`
async: false async: false
alias Explorer.Chain.Address
alias Explorer.Counters.AddressesCounter alias Explorer.Counters.AddressesCounter
describe "GET index/2" do describe "GET index/2" do
@ -50,7 +51,7 @@ defmodule BlockScoutWeb.AddressControllerTest do
test "returns address counters" do test "returns address counters" do
address = insert(:address) address = insert(:address)
conn = get(conn, "/address_counters", %{"id" => to_string(address.hash)}) conn = get(conn, "/address_counters", %{"id" => Address.checksum(address.hash)})
assert conn.status == 200 assert conn.status == 200
{:ok, response} = Jason.decode(conn.resp_body) {:ok, response} = Jason.decode(conn.resp_body)

@ -122,7 +122,7 @@ defmodule BlockScoutWeb.AddressTokenTransferControllerTest do
conn = conn =
get( get(
conn, conn,
address_token_transfers_path(conn, :index, address.hash, token.contract_address_hash), address_token_transfers_path(conn, :index, Address.checksum(address.hash), token.contract_address_hash),
%{type: "JSON"} %{type: "JSON"}
) )
@ -213,7 +213,7 @@ defmodule BlockScoutWeb.AddressTokenTransferControllerTest do
%Token{contract_address_hash: token_hash} = insert(:token) %Token{contract_address_hash: token_hash} = insert(:token)
conn = conn =
get(conn, address_token_transfers_path(conn, :index, Address.checksum(address_hash), token_hash), %{ get(conn, address_token_transfers_path(conn, :index, Address.checksum(address_hash), Address.checksum(token_hash)), %{
type: "JSON" type: "JSON"
}) })
@ -225,7 +225,7 @@ defmodule BlockScoutWeb.AddressTokenTransferControllerTest do
token_hash = "0x8bf38d4764929064f2d4d3a56520a76ab3df415b" token_hash = "0x8bf38d4764929064f2d4d3a56520a76ab3df415b"
conn = conn =
get(conn, address_token_transfers_path(conn, :index, address_hash, token_hash), %{ get(conn, address_token_transfers_path(conn, :index, Address.checksum(address_hash), Address.checksum(token_hash)), %{
type: "JSON" type: "JSON"
}) })

Loading…
Cancel
Save