Files
nairobi/spec/system/cookies_consent_spec.rb
taitus 1958a77842 Allow accept essential cookies from consent banner
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
2025-01-23 16:48:53 +01:00

25 lines
638 B
Ruby

require "rails_helper"
describe "Cookies consent" do
before { Setting["feature.cookies_consent"] = true }
context "Banner consent" do
scenario "Hides the banner when accepting essential cookies and for consecutive visits" do
visit root_path
expect(cookie_by_name("cookies_consent")).to be nil
within ".cookies-consent-banner" do
click_button "Accept essential cookies"
end
expect(cookie_by_name("cookies_consent")[:value]).to eq "essential"
expect(page).not_to have_content "Cookies policy"
refresh
expect(page).not_to have_content "Cookies policy"
end
end
end