Sha256: d21052001d8606fcf07a0d57ecf5455968be0f1dc3c003e6961812f9889523a2
Contents?: true
Size: 880 Bytes
Versions: 18
Compression:
Stored size: 880 Bytes
Contents
# frozen_string_literal: true require "hanami/config/actions" RSpec.describe Hanami::Config::Actions, "#cookies" do let(:config) { described_class.new } subject(:cookies) { config.cookies } context "default config" do it "is enabled" do expect(cookies).to be_enabled end it "is an empty hash" do expect(cookies.to_h).to eq({}) end end context "options given" do before do config.cookies = {max_age: 300} end it "is enabled" do expect(cookies).to be_enabled end it "returns the given options" do expect(cookies.to_h).to eq(max_age: 300) end end context "nil value given" do before do config.cookies = nil end it "is not enabled" do expect(cookies).not_to be_enabled end it "returns an empty hash" do expect(cookies.to_h).to eq({}) end end end
Version data entries
18 entries across 18 versions & 1 rubygems