Change summary
lib/btc_sell_prices.rb | 2 +-
test/test_btc_sell_prices.rb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Detailed changes
@@ -27,7 +27,7 @@ class BTCSellPrices
end
BigDecimal(
- bitcoin_row.at("td:nth-of-type(3)").text.match(/^\$(\d+\.\d+)/)[1]
+ bitcoin_row.at("td:nth-of-type(4)").text.match(/^\$(\d+\.\d+)/)[1]
)
end
end
@@ -13,7 +13,7 @@ class BTCSellPricesTest < Minitest::Test
def test_cad
stub_request(:get, "https://www.canadianbitcoins.com").to_return(
body: "<div id='ticker'><table><tbody><tr>" \
- "<td>Bitcoin</td><td></td><td>$123.00</td>"
+ "<td>Bitcoin</td><td></td><td></td><td>$123.00</td>"
)
assert_equal BigDecimal(123), @subject.cad.sync
end
@@ -22,7 +22,7 @@ class BTCSellPricesTest < Minitest::Test
def test_usd
stub_request(:get, "https://www.canadianbitcoins.com").to_return(
body: "<div id='ticker'><table><tbody><tr>" \
- "<td>Bitcoin<td></td><td>$123.00</td>"
+ "<td>Bitcoin<td></td><td></td><td>$123.00</td>"
)
@redis.expect(:get, EMPromise.resolve("0.5"), ["cad_to_usd"])
assert_equal BigDecimal(123) / 2, @subject.usd.sync