Files
openfoodnetwork/spec/controllers/admin/invoice_settings_controller_spec.rb
Maikel Linke dcb6f4676d Remove all unnecessary spec_helper require statements
The `.rspec` file is doing this for us.
2026-01-21 12:35:34 +11:00

35 lines
686 B
Ruby

# frozen_string_literal: true
RSpec.describe Admin::InvoiceSettingsController do
describe "#update" do
let(:params) {
{
preferences: {
enable_invoices?: 0,
invoice_style2?: 1,
}
}
}
before do
allow(controller).to receive(:spree_current_user) { create(:admin_user) }
end
it "disables invoices" do
expect {
post :update, params:
}.to change {
Spree::Config[:enable_invoices?]
}.to(false)
end
it "changes the invoice style" do
expect {
post :update, params:
}.to change {
Spree::Config[:invoice_style2?]
}.to(true)
end
end
end