Files
openfoodnetwork/spec/system/admin/configuration/mail_methods_spec.rb
Maikel Linke 5c6d9a092e Simplify login spec helpers, avoid long lines
The `login_as_admin_and_visit` helper was used a lot but isn't really
shorter than:

    login_as_admin
    visit path_visit

Calling those methods separately reduces line length. It also removes
the potential impression that it may be more efficient to use the
helper. Now we have less indirection if one of the calls fails and see
the failing spec line straight away.
2023-04-17 11:08:32 +10:00

26 lines
605 B
Ruby

# frozen_string_literal: true
require 'system_helper'
describe "Mail Methods" do
include AuthenticationHelper
before do
login_as_admin
visit spree.edit_admin_general_settings_path
end
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'
fill_in 'mail_bcc', with: 'bcc@example.com'
expect(page).to have_field('intercept_email', disabled: true)
click_button 'Update'
expect(page).to have_content('successfully updated!')
end
end
end