Render third party cookies in the management component
Set cookie duration to 365 days based on the AEPD's cookie usage guidelines. Note from the document: "Cookies with a duration of up to 24 months are considered acceptable as long as they are periodically updated." Reference: https://www.aepd.es/guias/guia-cookies.pdf
This commit is contained in:
@@ -22,6 +22,7 @@ describe Layout::CookiesConsent::ManagementComponent do
|
||||
expect(page).to have_link "More information about cookies", href: "/cookies_policy"
|
||||
expect(page).to have_css "h3", text: "Essential cookies"
|
||||
expect(page).to have_css ".switch-input[type='checkbox'][name='essential_cookies'][disabled][checked]"
|
||||
expect(page).to have_css "h3", text: "Third party cookies"
|
||||
expect(page).to have_button "Accept all"
|
||||
expect(page).to have_button "Accept essential cookies"
|
||||
end
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Layout::CookiesConsent::VendorsComponent do
|
||||
before { Setting["feature.cookies_consent"] = true }
|
||||
|
||||
it "is not rendered when there are no vendors" do
|
||||
render_inline Layout::CookiesConsent::VendorsComponent.new
|
||||
|
||||
expect(page).not_to be_rendered
|
||||
end
|
||||
|
||||
it "renders vendors content when there are vendors" do
|
||||
create(:cookies_vendor, name: "Vendor cookie", cookie: "third_party")
|
||||
|
||||
render_inline Layout::CookiesConsent::VendorsComponent.new
|
||||
|
||||
expect(page).to be_rendered
|
||||
expect(page).to have_content "Third party cookies"
|
||||
expect(page).to have_content "Vendor cookie"
|
||||
expect(page).to have_css ".switch-input[type='checkbox'][name='third_party']"
|
||||
expect(page).to have_button "Save preferences"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user