test/test_bitfex.rb in bitfex-1.1.0 vs test/test_bitfex.rb in bitfex-1.2.0
- old
+ new
@@ -18,20 +18,20 @@
client.server_url = 'https://google.com/'
assert_equal 'https://google.com/', client.server_url
end
def test_auth_success
- stub_request(:post, 'https://bitfex.trade/auth')
+ stub_request(:post, 'https://auth.bitfex.trade/auth')
.with(body: '{"auth":{"email":"user@example.com","password":"123"}}')
.to_return(status: 200, body: '{"jwt":"token"}')
client = Bitfex::Api.new
assert_equal 'token', client.auth('user@example.com', '123')
end
def test_auth_failure
- stub_request(:post, 'https://bitfex.trade/auth')
+ stub_request(:post, 'https://auth.bitfex.trade/auth')
.with(body: '{"auth":{"email":"user@example.com","password":"123"}}')
.to_return(status: 404, body: '{}')
assert_raises Bitfex::AuthError do
client = Bitfex::Api.new
@@ -60,27 +60,27 @@
client.balances
end
end
def test_orders_list_success
- stub_request(:get, "https://bitfex.trade/api/v1/orders")
+ stub_request(:get, "https://bitfex.trade/api/v1/orders?pair=BTC_RUR")
.with(headers: { 'Authorization' => 'Bearer 123' })
.to_return(status: 200, body: '{"success":true,"orders":[{"id":1}]}')
client = Bitfex::Api.new
client.token = '123'
- assert_equal([{'id' => 1}], client.orders_list)
+ assert_equal([{'id' => 1}], client.orders_list('BTC_RUR'))
end
def test_orders_list_faulure
- stub_request(:get, "https://bitfex.trade/api/v1/orders")
+ stub_request(:get, "https://bitfex.trade/api/v1/orders?pair=BTC_RUR")
.with(headers: { 'Authorization' => 'Bearer 123' })
.to_return(status: 403, body: '{"success":false,"errors":["TEST"]}')
assert_raises Bitfex::ApiError do
client = Bitfex::Api.new
client.token = '123'
- client.orders_list
+ client.orders_list('BTC_RUR')
end
end
def test_my_orders_success
stub_request(:get, "https://bitfex.trade/api/v1/orders/my")