2018-03-04 15:09:32 +00:00
|
|
|
require_relative '../../../spec_helper'
|
2017-05-07 12:04:49 +00:00
|
|
|
require 'cgi'
|
|
|
|
|
|
|
|
describe "CGI::Cookie#expires" do
|
|
|
|
it "returns self's expiration date" do
|
|
|
|
cookie = CGI::Cookie.new("test-cookie")
|
|
|
|
cookie.expires.should be_nil
|
|
|
|
|
|
|
|
cookie = CGI::Cookie.new("name" => "test-cookie", "expires" => Time.at(1196524602))
|
|
|
|
cookie.expires.should == Time.at(1196524602)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "CGI::Cookie#expires=" do
|
|
|
|
it "sets self's expiration date" do
|
|
|
|
cookie = CGI::Cookie.new("test-cookie")
|
|
|
|
cookie.expires = Time.at(1196524602)
|
|
|
|
cookie.expires.should == Time.at(1196524602)
|
|
|
|
|
|
|
|
cookie.expires = Time.at(1196525000)
|
|
|
|
cookie.expires.should == Time.at(1196525000)
|
|
|
|
end
|
|
|
|
end
|