Make publishing of BTCPay wallet balances optional
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Râu Cao
2023-09-20 18:36:53 +02:00
parent 91d3b977e9
commit 69fffb29d8
4 changed files with 46 additions and 0 deletions

View File

@@ -39,6 +39,18 @@ RSpec.describe "/api/btcpay", type: :request do
expect(res["error"]).not_to be_nil
end
end
context "feature disabled" do
before do
Setting.btcpay_publish_wallet_balances = false
end
it "returns a 404 status" do
get api_btcpay_onchain_btc_balance_path
expect(response).to have_http_status(:not_found)
end
end
end
describe "GET /lightning_btc_balance" do
@@ -75,5 +87,17 @@ RSpec.describe "/api/btcpay", type: :request do
expect(res["error"]).not_to be_nil
end
end
context "feature disabled" do
before do
Setting.btcpay_publish_wallet_balances = false
end
it "returns a 404 status" do
get api_btcpay_lightning_btc_balance_path
expect(response).to have_http_status(:not_found)
end
end
end
end