zendesk2 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 270b2d17ca7f778a7021f68b64e4cbe4451f48bd
4
- data.tar.gz: bd9144b1cc0adb733437334f62b60ed38daa6558
3
+ metadata.gz: 279574410b23569961ce3ebf883b5b34cbe2010f
4
+ data.tar.gz: 586cea4bcc15a218d53fa0e0422e32c04734431f
5
5
  SHA512:
6
- metadata.gz: 84675208061a34c5b10bffecc1f06b78f6842aa6c2503bfac0a916a565d6e080dbdba095906ff27d9cd00cbb41df663099ef1a86bd3d86ae3cbe5aaeb60c67e8
7
- data.tar.gz: c3c62ea6e1ed67e048f2cefe75fec4f142846776063461730f2f89110b88d9fe8b081c49a785ba10f54a10147d27a796e4281fe188dd87c2024b523de92e2c0d
6
+ metadata.gz: 69d5003ad442219c61c602a412c7a983ebbace73c9d43d73b479f8c76f54c51cb74912c40fec279523388a8b35139360e79ed7a50b48806339db0823d846d1b5
7
+ data.tar.gz: 75e9f81026df83afdcbe0bf588490e3b5fcea9ec99200b9762e2a9f1763ec09300879a1d9a460a770b43cad877c21b876f39dcc189b437615ff7858a3c56e779
@@ -16,9 +16,14 @@ class Zendesk2::Client
16
16
  path = "/users/#{id}.json"
17
17
 
18
18
  tickets = self.data[:tickets].values.select{|t| t["requester_id"] == id}.size
19
+
19
20
  find!(:users, id)
21
+
20
22
  if tickets < 1
23
+ self.data[:identities].each { |k,v| self.data[:identities].delete(k) if v["user_id"] == id }
24
+
21
25
  body = self.data[:users].delete(id)
26
+
22
27
  response(
23
28
  :method => :delete,
24
29
  :path => path,
@@ -1,3 +1,3 @@
1
1
  module Zendesk2
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
@@ -27,5 +27,17 @@ describe "user_identities" do
27
27
  client.create_user_identity("type" => "email", "value" => user.email, "user_id" => user.id)
28
28
  }.to raise_exception(Zendesk2::Error, /is already being used by another user/)
29
29
  end
30
+
31
+ it "should be allowed if the user is deleted" do
32
+ email = user.email
33
+ user.destroy
34
+
35
+ expect {
36
+ client.create_user_identity("type" => "email",
37
+ "value" => email,
38
+ "user_id" => another_user.id,
39
+ )
40
+ }.to change { another_user.identities.all.count }.by(1)
41
+ end
30
42
  end
31
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane