cookie_cutter 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -107,7 +107,7 @@ module CookieCutter
107
107
  def initialize(cookie_jar, options={})
108
108
  @cookie_jar = cookie_jar
109
109
  @secure_request = options[:secure_request]
110
- @cookie_name = options[:cookie_name] || self.class.cookie_name
110
+ @cookie_name = (options[:cookie_name] || self.class.cookie_name).downcase
111
111
  end
112
112
 
113
113
  def secure_request?
@@ -1,3 +1,3 @@
1
1
  module CookieCutter
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
data/spec/base_spec.rb CHANGED
@@ -17,12 +17,6 @@ class MultiValuedCookie < CookieCutter::Base
17
17
  has_attribute :value2, store_as: 'val2'
18
18
  end
19
19
 
20
- class MyMixedCaseCookie < CookieCutter::Base
21
- store_as :my_uppercase_cookie
22
-
23
- has_attribute :mixed_case_key, store_as: 'mixedcasekey'
24
- end
25
-
26
20
  describe CookieCutter::Base do
27
21
  let(:cookie_jar) { CookieCutter::TestSupport::FakeCookieJar.new }
28
22
  it 'should not update the cookie_jar when no value is set' do
@@ -42,6 +36,11 @@ describe CookieCutter::Base do
42
36
  cookie = EmptyValuedCookie.find(request, {cookie_name: legacy_cookie})
43
37
  cookie.cookie_name.should == legacy_cookie
44
38
  end
39
+ it 'should store the cookie with a lower-case name' do
40
+ request = double('http_request', scheme: 'https', cookie_jar: cookie_jar)
41
+ cookie = EmptyValuedCookie.find(request, {cookie_name: 'ABCabc1234'})
42
+ cookie.cookie_name.should == 'abcabc1234'
43
+ end
45
44
  end
46
45
  describe 'domain' do
47
46
  it 'does not set domain if not given' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookie_cutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-12-26 00:00:00.000000000 Z
13
+ date: 2014-01-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -112,19 +112,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  - - ! '>='
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
+ segments:
116
+ - 0
117
+ hash: 2405927852129059589
115
118
  required_rubygems_version: !ruby/object:Gem::Requirement
116
119
  none: false
117
120
  requirements:
118
121
  - - ! '>='
119
122
  - !ruby/object:Gem::Version
120
123
  version: '0'
124
+ segments:
125
+ - 0
126
+ hash: 2405927852129059589
121
127
  requirements: []
122
128
  rubyforge_project:
123
- rubygems_version: 1.8.25
129
+ rubygems_version: 1.8.24
124
130
  signing_key:
125
131
  specification_version: 3
126
132
  summary: Provides a way to define the structure, lifetime, and other properties of
127
133
  a cookie all in one place.
128
134
  test_files:
129
135
  - spec/base_spec.rb
130
- has_rdoc: