From a5a7ebbba20bdaf8bdb1de6f58c617ebb92bb076 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 8 Jul 2024 12:07:37 +0300 Subject: [PATCH] fix exchange rate flickering test (#10383) --- .../controllers/api/v2/stats_controller_test.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/block_scout_web/test/block_scout_web/controllers/api/v2/stats_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/api/v2/stats_controller_test.exs index 85ac41e1d1..907569ccb3 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/api/v2/stats_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/api/v2/stats_controller_test.exs @@ -37,6 +37,17 @@ defmodule BlockScoutWeb.API.V2.StatsControllerTest do end describe "/stats/charts/market" do + setup do + configuration = Application.get_env(:explorer, Explorer.ExchangeRates) + Application.put_env(:explorer, Explorer.ExchangeRates, enabled: false) + + :ok + + on_exit(fn -> + Application.put_env(:explorer, Explorer.ExchangeRates, configuration) + end) + end + test "get empty data", %{conn: conn} do request = get(conn, "/api/v2/stats/charts/market") assert response = json_response(request, 200)