File: cookie_jar_spec.rb

package info (click to toggle)
ruby-rack-test 0.7.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 296 kB
  • sloc: ruby: 1,900; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require "spec_helper"

describe Rack::Test::CookieJar do
  subject(:jar) { Rack::Test::CookieJar.new }

  describe "#get_cookie" do
    context "with a populated jar" do
      let(:cookie_value) { "foo;abc" }
      let(:cookie_name) { "a_cookie_name" }

      before do
        jar[cookie_name] = cookie_value
      end

      it "returns full cookie objects" do
        cookie = jar.get_cookie(cookie_name)
        expect(cookie).to be_a(Rack::Test::Cookie)
      end
    end
  end
end