mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
37 lines
709 B
Ruby
37 lines
709 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
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
|