require 'open_food_network/feature_toggle'

beta_testers = ENV['BETA_TESTERS']&.split(/[\s,]+/) || []

OpenFoodNetwork::FeatureToggle.enable(:customer_balance) do |user|
  if beta_testers == ['all']
    true
  else
    beta_testers.include?(user.email)
  end
end

OpenFoodNetwork::FeatureToggle.enable(:unit_price) do
  Rails.env.development?
end

require 'open_food_network/feature_toggle'

beta_testers = ENV['BETA_TESTERS']&.split(/[\s,]+/) || []

OpenFoodNetwork::FeatureToggle.enable(:customer_balance) do |user|
  !Rails.env.test?
end

OpenFoodNetwork::FeatureToggle.enable(:unit_price) do
  Rails.env.development?
end

Enable customer_balance to all users
Enable customer_balance to all users

This however makes the tests still pass, which rely on the off-branch
logic of the toggle. We'll work on them next.
