Implement bitcoin donations via BTCPay

This commit is contained in:
2024-02-14 11:09:03 +01:00
parent 26d613bdca
commit 079ee8833c
46 changed files with 1142 additions and 114 deletions

View File

@@ -0,0 +1,35 @@
require 'rails_helper'
RSpec.describe 'Donations page', type: :feature do
let(:user) { create :user }
before do
login_as user, :scope => :user
end
describe "Donation methods" do
scenario "Only BTCPay enabled" do
Setting.btcpay_enabled = true
Setting.lndhub_enabled = false
Setting.opencollective_enabled = false
visit contributions_donations_url
within ".donation-methods" do
expect(page).to have_content("Bitcoin")
expect(page).not_to have_content("OpenCollective")
end
end
scenario "Only OpenCollective enabled" do
Setting.btcpay_enabled = false
Setting.lndhub_enabled = false
Setting.opencollective_enabled = true
visit contributions_donations_url
within ".donation-methods" do
expect(page).not_to have_content("Bitcoin")
expect(page).to have_content("OpenCollective")
end
end
end
end