add more test cases

pull/1696/head
Ayrat Badykov 6 years ago
parent 09ff65c23f
commit 6a4f721f4e
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 10
      apps/block_scout_web/test/block_scout_web/controllers/chain_controller_test.exs

@ -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

Loading…
Cancel
Save