diff --git a/app/helpers/cookies_policy_helper.rb b/app/helpers/cookies_policy_helper.rb index 98db25d698..5bcec92383 100644 --- a/app/helpers/cookies_policy_helper.rb +++ b/app/helpers/cookies_policy_helper.rb @@ -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" diff --git a/spec/helpers/cookies_policy_helper_spec.rb b/spec/helpers/cookies_policy_helper_spec.rb index 2e4fbfa25d..b09f578a32 100644 --- a/spec/helpers/cookies_policy_helper_spec.rb +++ b/spec/helpers/cookies_policy_helper_spec.rb @@ -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