The rest connector module moves most of the functionality of http connection out of the client and into a module. The goal is to simplify method calls and DRY up the code. Changes include replacing all calls to send_request with calls to either 'get' or 'post'. process request now returns the "data" portion of the JSON response from the server, as every method was retrieving that separately. removed some untested code.
20 lines
492 B
Ruby
20 lines
492 B
Ruby
## Verifies test variables have been set correctly
|
|
#
|
|
# Use 'set_constants.sh' to pre-configure test variables
|
|
# e.g.
|
|
# source ./spec/set_constants.sh https://test.bitpay.com testuser@gmail.com mypassword
|
|
#
|
|
|
|
ROOT_ADDRESS = ENV['RCROOTADDRESS']
|
|
TEST_USER = ENV['RCTESTUSER']
|
|
TEST_PASS = ENV['RCTESTPASSWORD']
|
|
DASHBOARD_URL = "#{ROOT_ADDRESS}/dashboard/merchant/home"
|
|
|
|
unless
|
|
ROOT_ADDRESS &&
|
|
TEST_USER &&
|
|
TEST_PASS
|
|
then
|
|
raise "Missing configuration options - see constants.rb"
|
|
end
|