Files
openfoodnetwork/spec/system/admin/tax_settings_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

36 lines
837 B
Ruby

# frozen_string_literal: true
require 'system_helper'
describe 'Account and Billing Settings' do
include AuthenticationHelper
include WebHelper
describe "updating" do
before do
Spree::Config.set(products_require_tax_category: false)
end
context "as an admin user" do
it "loads the page" do
login_as_admin
visit spree.edit_admin_general_settings_path
click_link "Tax Settings"
expect(page).to have_unchecked_field 'preferences_products_require_tax_category'
end
it "attributes can be changed" do
login_as_admin
visit spree.edit_admin_tax_settings_path
check 'preferences_products_require_tax_category'
click_button "Update"
expect(Spree::Config.products_require_tax_category).to be true
end
end
end
end