Files
openfoodnetwork/spec/features/admin/configuration/mail_methods_spec.rb
Pau Perez 063d44fecc Disable mail methods form fields except mails_from
This moves a step closer to having a simple and straightforward way to
configure the app's mail delivery which doesn't require to be a nuclear
engineer to troubleshoot mail issues.

It happens way too often that servers have mail config broken when
restarted or redeployed and it takes too much brain power to fix it. No
doubt; it's way too complex.

I chose to leave this page's form fields but "Send mails as" as
read-only. This other field is still used by instance manager to
troubleshoot mail issues.
2021-02-01 18:45:02 +01:00

23 lines
605 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe "Mail Methods" do
include AuthenticationHelper
before { login_as_admin_and_visit spree.edit_admin_general_settings_path }
context "edit" do
before { click_link "Mail Method Settings" }
it "only allows changing the mails_from setting" do
fill_in 'mails_from', with: 'ofn@example.com'
expect(page).to have_field('mail_bcc', disabled: true)
expect(page).to have_field('intercept_email', disabled: true)
click_button 'Update'
expect(page).to have_content('successfully updated!')
end
end
end