mixpanel-ruby 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -218,11 +218,13 @@ module Mixpanel
218
218
  end
219
219
 
220
220
  # Permanently delete a profile from \Mixpanel people analytics
221
- def delete_user(distinct_id)
221
+ # To delete a user and ignore alias pass into optional params
222
+ # {"$ignore_alias"=>true}
223
+ def delete_user(distinct_id, optional_params={})
222
224
  update({
223
225
  '$distinct_id' => distinct_id,
224
226
  '$delete' => ''
225
- })
227
+ }.merge(optional_params))
226
228
  end
227
229
 
228
230
  # Send a generic update to \Mixpanel people analytics.
@@ -1,3 +1,3 @@
1
1
  module Mixpanel
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  end
@@ -178,4 +178,26 @@ describe Mixpanel::People do
178
178
  '$delete' => ''
179
179
  }]])
180
180
  end
181
+
182
+ it 'should send a well formed engage/delete message with blank optional_params' do
183
+ @people.delete_user("TEST ID", {})
184
+ expect(@log).to eq([[:profile_update, 'data' => {
185
+ '$token' => 'TEST TOKEN',
186
+ '$distinct_id' => 'TEST ID',
187
+ '$time' => @time_now.to_i * 1000,
188
+ '$delete' => ''
189
+ }]])
190
+ end
191
+
192
+ it 'should send a well formed engage/delete message with ignore_alias true' do
193
+ @people.delete_user("TEST ID", {"$ignore_alias"=>true})
194
+ expect(@log).to eq([[:profile_update, 'data' => {
195
+ '$token' => 'TEST TOKEN',
196
+ '$distinct_id' => 'TEST ID',
197
+ '$time' => @time_now.to_i * 1000,
198
+ '$delete' => '',
199
+ "$ignore_alias"=>true
200
+ }]])
201
+ end
202
+
181
203
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixpanel-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-25 00:00:00.000000000 Z
12
+ date: 2014-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake