mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
In cookies policy helper, added string interpolation to variable to avoid variable (Spree::Config entry) to break the concatenation. Added unit test to validate the error case
This commit is contained in:
@@ -7,7 +7,7 @@ module CookiesPolicyHelper
|
||||
end
|
||||
|
||||
def matomo_iframe_src
|
||||
Spree::Config.matomo_url\
|
||||
"#{Spree::Config.matomo_url}"\
|
||||
"/index.php?module=CoreAdminHome&action=optOut"\
|
||||
"&language=#{locale_language}"\
|
||||
"&backgroundColor=&fontColor=222222&fontSize=16px&fontFamily=%22Roboto%22%2C%20Arial%2C%20sans-serif"
|
||||
|
||||
@@ -12,9 +12,18 @@ describe CookiesPolicyHelper, type: :helper do
|
||||
end
|
||||
|
||||
describe "matomo optout iframe src" do
|
||||
scenario "includes matomo URL" do
|
||||
Spree::Config.matomo_url = "http://matomo.org/"
|
||||
expect(helper.matomo_iframe_src).to include Spree::Config.matomo_url
|
||||
describe "when matomo url is set" do
|
||||
before do
|
||||
Spree::Config.matomo_url = "http://matomo.org/"
|
||||
end
|
||||
|
||||
scenario "includes the matomo URL" do
|
||||
expect(helper.matomo_iframe_src).to include Spree::Config.matomo_url
|
||||
end
|
||||
|
||||
scenario "is not equal to the matomo URL" do
|
||||
expect(helper.matomo_iframe_src).to_not eq Spree::Config.matomo_url
|
||||
end
|
||||
end
|
||||
|
||||
scenario "is not nil, when matomo url is nil" do
|
||||
|
||||
Reference in New Issue
Block a user