Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid committed Mar 12, 2024
1 parent e27e3fa commit a8db005
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/controllers/api/v1/suggest_queries_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/services/charts/daily_statistic_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit a8db005

Please sign in to comment.