spec/lib/stellar/client_spec.rb in stellar-sdk-0.6.0 vs spec/lib/stellar/client_spec.rb in stellar-sdk-0.7.0
- old
+ new
@@ -31,9 +31,30 @@
client = described_class.new(horizon: custom_horizon_url)
expect(client.horizon._url).to eq(custom_horizon_url)
end
end
+ describe "#friendbot" do
+ let(:client) { Stellar::Client.default_testnet }
+ let(:account) { Stellar::Account.random }
+
+ it("requests for XLM from a friendbot", {
+ vcr: {record: :once, match_requests_on: [:method]}
+ }) do
+ response = client.friendbot(account)
+
+ expect(response).to be_success
+
+ destination_info = client.account_info(account)
+ balances = destination_info.balances
+ expect(balances).to_not be_empty
+ native_asset_balance_info = balances.find do |b|
+ b["asset_type"] == "native"
+ end
+ expect(native_asset_balance_info["balance"].to_f).to be > 0
+ end
+ end
+
describe "#create_account" do
let(:source) { Stellar::Account.from_seed(CONFIG[:source_seed]) }
let(:destination) { Stellar::Account.random }
it "creates the account", vcr: {record: :once, match_requests_on: [:method]} do