kissmetrics 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -61,7 +61,7 @@ module Kissmetrics
61
61
 
62
62
  def to_s
63
63
  @hash.collect do |key, value|
64
- "#{key}=#{CGI.escape(value.to_s)}"
64
+ "#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}"
65
65
  end.join('&')
66
66
  end
67
67
  end
@@ -67,17 +67,28 @@ describe Kissmetrics::HttpClient, "setting properties" do
67
67
 
68
68
  it "sets properties when unidentified" do
69
69
  subject.set('identity', {
70
- 'Button color' => 'Blue',
71
- 'Background color' => 'Gray'
70
+ 'Button' => 'Blue',
71
+ 'Background' => 'Gray'
72
72
  })
73
73
 
74
74
  WebMock.should have_requested(:get, "https://trk.kissmetrics.com/s").with({
75
75
  :query => {
76
- :_k => 'my-api-key',
77
- :_p => 'identity',
78
- 'Button color' => 'Blue',
79
- 'Background color' => 'Gray'
76
+ :_k => 'my-api-key',
77
+ :_p => 'identity',
78
+ 'Button' => 'Blue',
79
+ 'Background' => 'Gray'
80
80
  }
81
81
  })
82
82
  end
83
+
84
+ it "escapes keys and values" do
85
+ http = stub('http', :use_ssl= => true, :get => true)
86
+ Net::HTTP.stub(:new => http)
87
+
88
+ http.should_receive(:get).with(%r{Some\+property=Some\+value})
89
+
90
+ subject.set('identity', {
91
+ 'Some property' => 'Some value'
92
+ })
93
+ end
83
94
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kissmetrics
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jason Morrison
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-28 00:00:00 -04:00
13
+ date: 2011-06-30 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- hash: -4086314605262870467
119
+ hash: 2269321523201679432
120
120
  segments:
121
121
  - 0
122
122
  version: "0"