Skip to content

Commit

Permalink
test(server): search transactions by lock hash
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed May 31, 2019
1 parent 5ac0e58 commit 5ab9804
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ class AddressTransactionsControllerTest < ActionDispatch::IntegrationTest
assert_equal CkbTransactionSerializer.new(ckb_transactions, options).serialized_json, response.body
end

test "should return corresponding ckb transactions with given lock hash" do
page = 1
page_size = 10
address = create(:address, :with_transactions)
ckb_transactions = address.ckb_transactions.order(block_timestamp: :desc).page(page).per(page_size)

valid_get api_v1_address_transaction_url(address.lock_hash)

options = FastJsonapi::PaginationMetaGenerator.new(request: request, records: ckb_transactions, page: page, page_size: page_size).call

assert_equal CkbTransactionSerializer.new(ckb_transactions, options).serialized_json, response.body
end

test "should contain right keys in the serialized object when call show" do
address = create(:address, :with_transactions)

Expand Down

0 comments on commit 5ab9804

Please sign in to comment.