diff --git a/test/test_customer.rb b/test/test_customer.rb index 6da8192abf0942d38d4e193b38afcaeeb9ca3038..9e82b339224d044d0b0147639d858b14a83026eb 100644 --- a/test/test_customer.rb +++ b/test/test_customer.rb @@ -13,6 +13,7 @@ CustomerUsage::REDIS = Minitest::Mock.new CustomerUsage::DB = Minitest::Mock.new CustomerFinancials::REDIS = Minitest::Mock.new CustomerFinancials::ELECTRUM = Minitest::Mock.new +CustomerFinancials::ELECTRUM_BCH = Minitest::Mock.new CustomerFinancials::BRAINTREE = Minitest::Mock.new class CustomerTest < Minitest::Test @@ -283,4 +284,21 @@ class CustomerTest < Minitest::Test assert_mock CustomerFinancials::ELECTRUM end em :test_add_btc_address + + def test_add_bch_address + CustomerFinancials::REDIS.expect( + :spopsadd, + EMPromise.resolve("testaddr"), + [["jmp_available_bch_addresses", "jmp_customer_bch_addresses-test"]] + ) + CustomerFinancials::ELECTRUM_BCH.expect( + :notify, + EMPromise.resolve(nil), + ["testaddr", "http://notify.example.com"] + ) + assert_equal "testaddr", customer.add_bch_address.sync + assert_mock CustomerFinancials::REDIS + assert_mock CustomerFinancials::ELECTRUM_BCH + end + em :test_add_bch_address end diff --git a/test/test_registration.rb b/test/test_registration.rb index 9d7f0ff3c866c55d3d3cebc800cdc0a197ecc432..0203207ed58608d4579f2cc13e3a7783bbca807e 100644 --- a/test/test_registration.rb +++ b/test/test_registration.rb @@ -665,7 +665,7 @@ class RegistrationTest < Minitest::Test [Matching.new do |reply| assert_equal :canceled, reply.status assert_equal "1.000000", reply.form.field("amount").value - assert_equal "testaddr", reply.form.field("bch_addresses").value + assert_equal "testaddr", reply.form.field("btc_addresses").value true end] ) @@ -692,7 +692,7 @@ class RegistrationTest < Minitest::Test customer(plan_name: "test_usd") ) @customer.expect( - :add_btc_address, + :add_bch_address, EMPromise.resolve("testaddr") ) @bch = Registration::Payment::BCH.new(