From a8db0059496c51826e5908b5e35feb90af0b9148 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Tue, 12 Mar 2024 15:14:02 +0800 Subject: [PATCH] test: fix test Signed-off-by: Miles Zhang --- test/controllers/api/v1/suggest_queries_controller_test.rb | 4 ++-- test/services/charts/daily_statistic_generator_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/controllers/api/v1/suggest_queries_controller_test.rb b/test/controllers/api/v1/suggest_queries_controller_test.rb index 15b04686b..cc1b4e7ad 100644 --- a/test/controllers/api/v1/suggest_queries_controller_test.rb +++ b/test/controllers/api/v1/suggest_queries_controller_test.rb @@ -11,7 +11,7 @@ class SuggestQueriesControllerTest < ActionDispatch::IntegrationTest end test "should set right content type when call show" do - valid_get api_v1_suggest_queries_url("0x3b238b3326d10ec000417b68bc715f17e86293d6cdbcb3fd8a628ad4a0b756f6") + valid_get api_v1_suggest_queries_url, params: { q: "0x3b238b3326d10ec000417b68bc715f17e86293d6cdbcb3fd8a628ad4a0b756f6" } assert_equal "application/vnd.api+json", response.media_type end @@ -191,7 +191,7 @@ class SuggestQueriesControllerTest < ActionDispatch::IntegrationTest :type_script, code_hash: Settings.type_id_code_hash, args: "0x8536c9d5d908bd89fc70099e4284870708b6632356aad98734fcf43f6f71c304", - script_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" + script_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", ) response_json = TypeScriptSerializer.new(type_script).serialized_json diff --git a/test/services/charts/daily_statistic_generator_test.rb b/test/services/charts/daily_statistic_generator_test.rb index 9b42f780b..cb3e5549a 100644 --- a/test/services/charts/daily_statistic_generator_test.rb +++ b/test/services/charts/daily_statistic_generator_test.rb @@ -236,7 +236,7 @@ class DailyStatisticGeneratorTest < ActiveSupport::TestCase create(:cell_output, :with_full_transaction, block_timestamp: @datetime.to_i * 1000, block: @block), ] - CellOutput.where(id: cells.map(&:id)).update_all(consumed_block_timestamp: (@datetime.to_i + 1) * 1000) + CellOutput.where(id: cells.map(&:id)).update_all(consumed_block_timestamp: (@datetime.to_i + 10) * 1000) is_from_scratch = true assert_equal "3", Charts::DailyStatisticGenerator.new(@datetime, @@ -246,7 +246,7 @@ class DailyStatisticGeneratorTest < ActiveSupport::TestCase # dead_cells_count = dead_cells_count_today + yesterday_daily_statistic.dead_cells_count.to_i # dead_cells_count_today = CellOutput.consumed_after(started_at).consumed_before(ended_at).count # - create :daily_statistic, created_at_unixtimestamp: @datetime.yesterday.to_i, dead_cells_count: 888 + create :daily_statistic, created_at_unixtimestamp: @datetime.yesterday.yesterday.to_i, dead_cells_count: 888 assert_equal (3 + 888).to_s, Charts::DailyStatisticGenerator.new(@datetime).call.dead_cells_count