mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Only show enabled connected app types
The preference will be set from the admin interface in a new commit It would be nice if we had an array/list type for preferences. Probably not too hard to implement, but this will do.
This commit is contained in:
committed by
Rachel Arnould
parent
fcea437d7e
commit
4223b36bc3
@@ -1,4 +1,3 @@
|
||||
= render partial: "/admin/enterprises/form/connected_apps/discover_regen",
|
||||
locals: { enterprise:, connected_app: enterprise.connected_apps.discover_regen.first }
|
||||
= render partial: "/admin/enterprises/form/connected_apps/affiliate_sales_data",
|
||||
locals: { enterprise:, connected_app: enterprise.connected_apps.affiliate_sales_data.first }
|
||||
- Spree::Config.connected_apps_enabled&.split(',')&.each do |type|
|
||||
= render partial: "/admin/enterprises/form/connected_apps/#{type}",
|
||||
locals: { enterprise:, connected_app: enterprise.connected_apps.public_send(type).first }
|
||||
|
||||
@@ -42,6 +42,16 @@ RSpec.describe "Connected Apps", feature: :connected_apps, vcr: true do
|
||||
expect(page).to have_content "CONNECTED APPS"
|
||||
end
|
||||
|
||||
|
||||
it "only shows enabled apps" do
|
||||
allow(Spree::Config).to receive(:connected_apps_enabled).and_return("discover_regen")
|
||||
|
||||
visit "#{edit_admin_enterprise_path(enterprise)}#/connected_apps_panel"
|
||||
|
||||
expect(page).to have_selector "h3", text: "Discover Regenerative"
|
||||
expect(page).not_to have_selector "h3", text: "INRAE / UFC QUE CHOISIR Research"
|
||||
end
|
||||
|
||||
describe "Discover Regenerative" do
|
||||
before do
|
||||
allow(Spree::Config).to receive(:connected_apps_enabled).and_return("discover_regen")
|
||||
|
||||
Reference in New Issue
Block a user