Skip to content
Snippets Groups Projects
Commit f26909ec authored by ABDELGHANI Nassim's avatar ABDELGHANI Nassim Committed by ABDELGHANI Nassim
Browse files

rewrite blockchain/current test with last block

parent ede2afba
No related branches found
No related tags found
1 merge request!46Resolve "Validation locale"
Pipeline #4320 passed
......@@ -4,14 +4,13 @@ defmodule HTTP.Blockchain.CurrentTest do
"""
use ExUnit.Case
# last block in our case is the 50th
@last_blcok '49'
@base_url 'https://g1-test.duniter.org/blockchain/block/' ++ @last_blcok
@base_url 'https://g1-test.duniter.org/blockchain/block/'
@base_url_localhost 'http://localhost:8085/blockchain/current'
test "HTTP Blockchain/current get test" do
{:ok, {_, _, res_baseline}} = :httpc.request(:get, {@base_url, []}, [], [])
last_block = DB.size('block') - 1
{:ok, {_, _, res_baseline}} = :httpc.request(:get, {@base_url ++ to_charlist(last_block), []}, [], [])
{:ok, {_, _, res}} = :httpc.request(:get, {@base_url_localhost, []}, [], [])
assert Poison.decode!(res) == Poison.decode!(res_baseline)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment