ticketmaster-zendesk 0.1.2 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.2.2
@@ -7,6 +7,7 @@ module TicketMaster::Provider
7
7
 
8
8
  SEARCH_API = ZendeskAPI::Search
9
9
  API = ZendeskAPI::Ticket
10
+ USER_API = ZendeskAPI::User
10
11
 
11
12
  def initialize(*object)
12
13
  return super(object.first) if object.first.is_a? Hash
@@ -54,7 +55,11 @@ module TicketMaster::Provider
54
55
 
55
56
  def self.find_all(*options)
56
57
  project_id = options.first
57
- SEARCH_API.find(:all, :params => {:query => "status:open"}).collect { |ticket| self.new([ticket, project_id])}
58
+ SEARCH_API.find(:all, :params => {:query => "status:open"}).collect do |ticket|
59
+ ticket.requester_id = requestor(ticket)
60
+ ticket.assignee_id = assignee(ticket)
61
+ self.new([ticket, project_id])
62
+ end
58
63
  end
59
64
 
60
65
  def self.find_by_id(project_id, ticket_id)
@@ -77,6 +82,15 @@ module TicketMaster::Provider
77
82
  end
78
83
  end
79
84
 
85
+ private
86
+ def self.requestor(ticket)
87
+ USER_API.find(ticket.requester_id).email
88
+ end
89
+
90
+ def self.assignee(ticket)
91
+ USER_API.find(ticket.assignee_id).email
92
+ end
93
+
80
94
  end
81
95
 
82
96
  end
@@ -46,4 +46,7 @@ module ZendeskAPI
46
46
  class Ticket < Base
47
47
  end
48
48
 
49
+ class User < Base
50
+ end
51
+
49
52
  end
@@ -0,0 +1 @@
1
+ {"is_verified":false,"name":"Kelly H","locale_id":null,"photo_url":"http://clutchapp.zendesk.com/images/types/user_sm.png","openid_url":null,"created_at":"2011/04/25 18:30:30 -0300","last_login":null,"details":null,"updated_at":"2011/04/25 18:30:30 -0300","notes":null,"external_id":null,"restriction_id":4,"id":55030073,"email":"kelly.h@zendesk.com","phone":null,"is_active":true,"time_zone":"Atlantic Time (Canada)","roles":0,"organization_id":null,"groups":[],"uses_12_hour_clock":false}
data/spec/tickets_spec.rb CHANGED
@@ -9,6 +9,8 @@ describe "Ticketmaster::Provider::Zendesk::Ticket" do
9
9
  ActiveResource::HttpMock.respond_to do |mock|
10
10
  mock.get '/search.json?query=status%3Aopen', headers, fixture_for('tickets', 'json'), 200
11
11
  mock.get '/tickets/1.json', headers, fixture_for('ticket', 'json'), 200
12
+ mock.get '/users/26218414.json', headers, fixture_for('users/55030073', 'json'), 200
13
+ mock.get '/users/26220353.json', headers, fixture_for('users/55030073', 'json'), 200
12
14
  end
13
15
  end
14
16
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-zendesk}
8
- s.version = "0.1.2"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rafael George"]
12
- s.date = %q{2011-04-27}
12
+ s.date = %q{2011-04-28}
13
13
  s.description = %q{Allows ticketmaster to interact with Your System.}
14
14
  s.email = %q{george.rafael@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -39,6 +39,7 @@ Gem::Specification.new do |s|
39
39
  "spec/fixtures/tickets/2.xml",
40
40
  "spec/fixtures/tickets/5.xml",
41
41
  "spec/fixtures/tickets/create.xml",
42
+ "spec/fixtures/users/55030073.json",
42
43
  "spec/projects_spec.rb",
43
44
  "spec/spec.opts",
44
45
  "spec/spec_helper.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-zendesk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
8
  - 2
10
- version: 0.1.2
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rafael George
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-27 00:00:00 +00:00
18
+ date: 2011-04-28 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -144,6 +144,7 @@ files:
144
144
  - spec/fixtures/tickets/2.xml
145
145
  - spec/fixtures/tickets/5.xml
146
146
  - spec/fixtures/tickets/create.xml
147
+ - spec/fixtures/users/55030073.json
147
148
  - spec/projects_spec.rb
148
149
  - spec/spec.opts
149
150
  - spec/spec_helper.rb