mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Admin can set bugherd API key
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
module Spree
|
||||
module Admin
|
||||
GeneralSettingsController.class_eval do
|
||||
end
|
||||
|
||||
|
||||
module GeneralSettingsEditPreferences
|
||||
def edit
|
||||
super
|
||||
@preferences_general << :bugherd_api_key
|
||||
end
|
||||
end
|
||||
GeneralSettingsController.send(:prepend, GeneralSettingsEditPreferences)
|
||||
end
|
||||
end
|
||||
@@ -23,4 +23,7 @@ Spree::AppConfiguration.class_eval do
|
||||
|
||||
# Monitoring
|
||||
preference :last_job_queue_heartbeat_at, :string, default: nil
|
||||
|
||||
# External services
|
||||
preference :bugherd_api_key, :string, default: nil
|
||||
end
|
||||
|
||||
22
spec/features/admin/external_services_spec.rb
Normal file
22
spec/features/admin/external_services_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature 'External services' do
|
||||
include AuthenticationWorkflow
|
||||
|
||||
describe "bugherd" do
|
||||
before do
|
||||
Spree::Config.bugherd_api_key = nil
|
||||
login_to_admin_section
|
||||
end
|
||||
|
||||
it "lets me set an API key" do
|
||||
visit spree.edit_admin_general_settings_path
|
||||
|
||||
fill_in 'bugherd_api_key', with: 'abc123'
|
||||
click_button 'Update'
|
||||
|
||||
page.should have_content 'General Settings has been successfully updated!'
|
||||
expect(Spree::Config.bugherd_api_key).to eq 'abc123'
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user