Sha256: 3379ef10c580f49769b44df42b6db4aa57747f3f562c69e89619904ea7843fa8
Contents?: true
Size: 783 Bytes
Versions: 21
Compression:
Stored size: 783 Bytes
Contents
require "spec_helper" require "httpi" describe HTTPI::CookieStore do let(:user_cookie) { some_cookie(:user, "chucknorris") } let(:token_cookie) { some_cookie(:token, "strawberry") } it "stores a set of cookies" do cookie_store = HTTPI::CookieStore.new cookie_store.add(user_cookie, token_cookie) expect(cookie_store.fetch).to include("user=chucknorris", "token=strawberry") # add a new token cookie with a different value token_cookie = some_cookie(:token, "choc-choc-chip") cookie_store.add(token_cookie) expect(cookie_store.fetch).to include("token=choc-choc-chip") expect(cookie_store.fetch).not_to include("token=strawberry") end def some_cookie(name, value) HTTPI::Cookie.new("#{name}=#{value}; Path=/; HttpOnly") end end
Version data entries
21 entries across 21 versions & 1 rubygems