|
|
|
@ -69,11 +69,21 @@ defmodule BlockScoutWeb.ChainControllerTest do |
|
|
|
|
describe "GET token_autocomplete/2" do |
|
|
|
|
test "finds matching tokens" do |
|
|
|
|
insert(:token, name: "MaGiC") |
|
|
|
|
insert(:token, name: "Evil") |
|
|
|
|
|
|
|
|
|
conn = get(conn(), "/token_autocomplete?q=magic") |
|
|
|
|
|
|
|
|
|
assert Enum.count(json_response(conn, 200)) == 1 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
test "finds two matching tokens" do |
|
|
|
|
insert(:token, name: "MaGiC") |
|
|
|
|
insert(:token, name: "magic") |
|
|
|
|
|
|
|
|
|
conn = get(conn(), "/token_autocomplete?q=magic") |
|
|
|
|
|
|
|
|
|
assert Enum.count(json_response(conn, 200)) == 2 |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "GET search/2" do |
|
|
|
|