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
24 lines
767 B
Ruby
24 lines
767 B
Ruby
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
|