Files
openfoodnetwork/spec/system/admin/configuration/connected_app_settings_spec.rb
David Cook 5d732d80a6 Add connected apps settings screen
I considered adding a request spec, but figured it still doesnt' test the form, so better to use a full system spec.
2024-08-06 11:26:03 +02:00

27 lines
787 B
Ruby

# frozen_string_literal: true
require 'system_helper'
RSpec.describe "Connected App Settings", feature: :connected_apps do
include AuthenticationHelper
before do
login_as_admin
visit spree.admin_dashboard_path
click_link "Configuration"
click_link "Connected app settings"
end
it "should update connected app enabled preferences" do
expect(page).to have_field "Discover Regenerative portal", checked: false
expect(page).to have_field "DFC anonymised orders API for research purposes", checked: false
check "Discover Regenerative portal"
check "DFC anonymised orders API for research purposes"
expect{
click_button "Update"
}.to change{ Spree::Config.connected_apps_enabled }.to("discover_regen,affiliate_sales_data")
end
end