mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Improve feature toggling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
.medium-6#checkout-payment-methods
|
||||
- if @order.distributor.vouchers.present?
|
||||
- if feature?(:vouchers, spree_current_user) && @order.distributor.vouchers.present?
|
||||
%div.checkout-substep
|
||||
= render partial: "split_checkout/voucher_section", locals: { order: @order, voucher_adjustment: @order.voucher_adjustments.first }
|
||||
|
||||
|
||||
@@ -707,6 +707,8 @@ describe "As a consumer, I want to checkout my order" do
|
||||
end
|
||||
|
||||
describe "vouchers" do
|
||||
before { Flipper.enable :vouchers }
|
||||
|
||||
context "with no voucher available" do
|
||||
before do
|
||||
visit checkout_step_path(:payment)
|
||||
|
||||
@@ -106,6 +106,8 @@ describe "As a consumer, I want to see adjustment breakdown" do
|
||||
end
|
||||
|
||||
context "when using a voucher" do
|
||||
before { Flipper.enable :vouchers }
|
||||
|
||||
let!(:voucher) do
|
||||
create(:voucher, code: 'some_code', enterprise: distributor, amount: 10)
|
||||
end
|
||||
|
||||
@@ -63,6 +63,7 @@ describe "As a consumer, I want to see adjustment breakdown" do
|
||||
before do
|
||||
# assures tax is charged in dependence of shipping address
|
||||
Spree::Config.set(tax_using_ship_address: true)
|
||||
Flipper.enable :vouchers
|
||||
end
|
||||
|
||||
describe "a not-included tax" do
|
||||
|
||||
Reference in New Issue
Block a user