mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
40 lines
803 B
Ruby
40 lines
803 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
RSpec.describe Admin::MatomoSettingsController do
|
|
describe "#update" do
|
|
let(:params) {
|
|
{
|
|
preferences: {
|
|
matomo_url: "test url",
|
|
matomo_site_id: "42",
|
|
matomo_tag_manager_url: "test manager url",
|
|
}
|
|
}
|
|
}
|
|
|
|
before do
|
|
allow(controller).to receive(:spree_current_user) { create(:admin_user) }
|
|
end
|
|
|
|
it "changes Matomo settings" do
|
|
expect {
|
|
post :update, params:
|
|
}.to change {
|
|
[
|
|
Spree::Config[:matomo_url],
|
|
Spree::Config[:matomo_site_id],
|
|
Spree::Config[:matomo_tag_manager_url],
|
|
]
|
|
}.to(
|
|
[
|
|
"test url",
|
|
"42",
|
|
"test manager url",
|
|
]
|
|
)
|
|
end
|
|
end
|
|
end
|