taskmapper-zendesk 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.rbenv-gemsets +1 -0
- data/.rvmrc +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +51 -0
- data/LICENSE +22 -0
- data/README.md +67 -0
- data/Rakefile +41 -0
- data/VERSION +1 -0
- data/lib/.DS_Store +0 -0
- data/lib/provider/comment.rb +74 -0
- data/lib/provider/project.rb +58 -0
- data/lib/provider/ticket.rb +97 -0
- data/lib/provider/zendesk.rb +40 -0
- data/lib/taskmapper-zendesk.rb +6 -0
- data/lib/zendesk/zendesk-api.rb +52 -0
- data/spec/.DS_Store +0 -0
- data/spec/comments_spec.rb +55 -0
- data/spec/fixtures/.DS_Store +0 -0
- data/spec/fixtures/ticket.json +1 -0
- data/spec/fixtures/tickets.json +1 -0
- data/spec/fixtures/tickets.xml +145 -0
- data/spec/fixtures/tickets/2.xml +52 -0
- data/spec/fixtures/tickets/5.xml +78 -0
- data/spec/fixtures/tickets/create.xml +24 -0
- data/spec/fixtures/users/55030073.json +1 -0
- data/spec/projects_spec.rb +29 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/taskmapper-zendesk_spec.rb +22 -0
- data/spec/tickets_spec.rb +59 -0
- data/taskmapper-zendesk.gemspec +86 -0
- metadata +152 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<ticket>
|
3
|
+
<assigned-at>2007-06-03T22:15:44Z</assigned-at>
|
4
|
+
<assignee-id>4</assignee-id>
|
5
|
+
<assignee-updated-at/>
|
6
|
+
<created-at>2007-06-03T20:15:44Z</created-at>
|
7
|
+
<subject></subject>
|
8
|
+
<description>My printer is not working</description>
|
9
|
+
<external-id/>
|
10
|
+
<group-id>2</group-id>
|
11
|
+
<id>2</id>
|
12
|
+
<linked-id/>
|
13
|
+
<priority-id>3</priority-id>
|
14
|
+
<submitter-id>3</submitter-id>
|
15
|
+
<status-id>1</status-id>
|
16
|
+
<status-updated-at>2007-06-03T22:15:44Z</status-updated-at>
|
17
|
+
<requester-id>3</requester-id>
|
18
|
+
<requester-updated-at>2007-06-03T22:15:44Z</requester-updated-at>
|
19
|
+
<ticket-type-id>2</ticket-type-id>
|
20
|
+
<updated-at>2007-06-03T20:15:45Z</updated-at>
|
21
|
+
<via-id>0</via-id>
|
22
|
+
<current-tags>printer hp</current-tags>
|
23
|
+
<score>28</score>
|
24
|
+
</ticket>
|
@@ -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}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe TaskMapper::Provider::Zendesk::Project do
|
4
|
+
before(:all) do
|
5
|
+
@project_id = 'foobar-project'
|
6
|
+
end
|
7
|
+
|
8
|
+
before(:each) do
|
9
|
+
@taskmapper = TaskMapper.new(:zendesk, {:account => 'hybridgroup', :username => 'foobar', :password => '123456'})
|
10
|
+
@klass = TaskMapper::Provider::Zendesk::Project
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should be able to load all projects" do
|
14
|
+
@taskmapper.projects.should be_an_instance_of(Array)
|
15
|
+
@taskmapper.projects.first.should be_an_instance_of(@klass)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should be able to load all projects from an array of id's" do
|
19
|
+
@projects = @taskmapper.projects([@project_id])
|
20
|
+
@projects.should be_an_instance_of(Array)
|
21
|
+
@projects.first.should be_an_instance_of(@klass)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should be able to load a single project by id" do
|
25
|
+
@project = @taskmapper.project(@project_id)
|
26
|
+
@project.should be_an_instance_of(@klass)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
+
require 'rubygems'
|
4
|
+
require 'taskmapper'
|
5
|
+
require 'taskmapper-zendesk'
|
6
|
+
require 'rspec'
|
7
|
+
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.color_enabled = true
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def fixture_for(name, format = 'xml')
|
15
|
+
File.read(File.dirname(__FILE__) + '/fixtures/' + name + ".#{format}")
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "TaskMapper::Provider::Zendesk" do
|
4
|
+
before(:each) do
|
5
|
+
@taskmapper = TaskMapper.new(:zendesk, {:account => 'taskmapper', :username => 'foo', :password => '000000'})
|
6
|
+
headers = {'Authorization' => 'Basic Zm9vOjAwMDAwMA==','Accept' => 'application/json'}
|
7
|
+
ActiveResource::HttpMock.respond_to do |mock|
|
8
|
+
mock.get '/search.json?query=status%3Aopen', headers, fixture_for('tickets', 'json'), 200
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should be able to instantiate a new instance" do
|
14
|
+
@taskmapper.should be_an_instance_of(TaskMapper)
|
15
|
+
@taskmapper.should be_a_kind_of(TaskMapper::Provider::Zendesk)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should be true with valid authentication" do
|
19
|
+
@taskmapper.valid?.should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe TaskMapper::Provider::Zendesk::Ticket do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@project_id = "hybridgroup-project"
|
7
|
+
|
8
|
+
headers = {'Authorization' => 'Basic cmFmYWVsQGh5YnJpZGdyb3VwLmNvbToxMjM0NTY=','Accept' => 'application/json'}
|
9
|
+
ActiveResource::HttpMock.respond_to do |mock|
|
10
|
+
mock.get '/search.json?query=status%3Aopen', headers, fixture_for('tickets', 'json'), 200
|
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
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
before(:each) do
|
18
|
+
@taskmapper = TaskMapper.new(:zendesk, :account => 'hybridgroup', :username => 'rafael@hybridgroup.com', :password => '123456')
|
19
|
+
@klass = TaskMapper::Provider::Zendesk::Ticket
|
20
|
+
@project = @taskmapper.project(@project_id)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should be able to load all tickets" do
|
24
|
+
@project.tickets.should be_an_instance_of(Array)
|
25
|
+
@project.tickets.first.should be_an_instance_of(@klass)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should be able to load all tickets based on an array of id's" do
|
29
|
+
tickets = @project.tickets([1])
|
30
|
+
tickets.should be_an_instance_of(Array)
|
31
|
+
tickets.first.should be_an_instance_of(@klass)
|
32
|
+
tickets.size.should == 1
|
33
|
+
tickets.first.title.should == "Testing"
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should be able to load all tickets based on attributes" do
|
37
|
+
tickets = @project.tickets(:id => 1)
|
38
|
+
tickets.should be_an_instance_of(Array)
|
39
|
+
tickets.first.should be_an_instance_of(@klass)
|
40
|
+
tickets.first.title.should == "Testing"
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should be able to load a single ticket" do
|
44
|
+
ticket = @project.ticket(1)
|
45
|
+
ticket.should be_an_instance_of(@klass)
|
46
|
+
ticket.title.should == "Testing"
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should be able to find a ticket by attributes" do
|
50
|
+
ticket = @project.ticket(:id => 1)
|
51
|
+
ticket.should be_an_instance_of(@klass)
|
52
|
+
ticket.title.should == "Testing"
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should return the ticket class without parameter in the ticket method" do
|
56
|
+
@project.ticket.should == @klass
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "taskmapper-zendesk"
|
8
|
+
s.version = "0.5.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Rafael George"]
|
12
|
+
s.date = "2012-05-11"
|
13
|
+
s.description = "Allows taskmapper to interact with Your System."
|
14
|
+
s.email = "rafael@hybridgroup.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".DS_Store",
|
21
|
+
".rbenv-gemsets",
|
22
|
+
".rvmrc",
|
23
|
+
".travis.yml",
|
24
|
+
"Gemfile",
|
25
|
+
"Gemfile.lock",
|
26
|
+
"LICENSE",
|
27
|
+
"README.md",
|
28
|
+
"Rakefile",
|
29
|
+
"VERSION",
|
30
|
+
"lib/.DS_Store",
|
31
|
+
"lib/provider/comment.rb",
|
32
|
+
"lib/provider/project.rb",
|
33
|
+
"lib/provider/ticket.rb",
|
34
|
+
"lib/provider/zendesk.rb",
|
35
|
+
"lib/taskmapper-zendesk.rb",
|
36
|
+
"lib/zendesk/zendesk-api.rb",
|
37
|
+
"spec/.DS_Store",
|
38
|
+
"spec/comments_spec.rb",
|
39
|
+
"spec/fixtures/.DS_Store",
|
40
|
+
"spec/fixtures/ticket.json",
|
41
|
+
"spec/fixtures/tickets.json",
|
42
|
+
"spec/fixtures/tickets.xml",
|
43
|
+
"spec/fixtures/tickets/2.xml",
|
44
|
+
"spec/fixtures/tickets/5.xml",
|
45
|
+
"spec/fixtures/tickets/create.xml",
|
46
|
+
"spec/fixtures/users/55030073.json",
|
47
|
+
"spec/projects_spec.rb",
|
48
|
+
"spec/spec.opts",
|
49
|
+
"spec/spec_helper.rb",
|
50
|
+
"spec/taskmapper-zendesk_spec.rb",
|
51
|
+
"spec/tickets_spec.rb",
|
52
|
+
"taskmapper-zendesk.gemspec"
|
53
|
+
]
|
54
|
+
s.homepage = "http://github.com/hybridgroup/taskmapper-zendesk"
|
55
|
+
s.require_paths = ["lib"]
|
56
|
+
s.rubygems_version = "1.8.17"
|
57
|
+
s.summary = "taskmapper Provider for Zendesk"
|
58
|
+
|
59
|
+
if s.respond_to? :specification_version then
|
60
|
+
s.specification_version = 3
|
61
|
+
|
62
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
63
|
+
s.add_runtime_dependency(%q<taskmapper>, ["~> 0.8"])
|
64
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8"])
|
65
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1"])
|
66
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
|
67
|
+
s.add_development_dependency(%q<simplecov>, ["~> 0.5"])
|
68
|
+
s.add_development_dependency(%q<rcov>, ["~> 1.0"])
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<taskmapper>, ["~> 0.8"])
|
71
|
+
s.add_dependency(%q<rspec>, ["~> 2.8"])
|
72
|
+
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
73
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6"])
|
74
|
+
s.add_dependency(%q<simplecov>, ["~> 0.5"])
|
75
|
+
s.add_dependency(%q<rcov>, ["~> 1.0"])
|
76
|
+
end
|
77
|
+
else
|
78
|
+
s.add_dependency(%q<taskmapper>, ["~> 0.8"])
|
79
|
+
s.add_dependency(%q<rspec>, ["~> 2.8"])
|
80
|
+
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
81
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6"])
|
82
|
+
s.add_dependency(%q<simplecov>, ["~> 0.5"])
|
83
|
+
s.add_dependency(%q<rcov>, ["~> 1.0"])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
metadata
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: taskmapper-zendesk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.5.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rafael George
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2012-05-11 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: taskmapper
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0.8"
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "2.8"
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: bundler
|
39
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "1.1"
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: jeweler
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "1.6"
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: simplecov
|
61
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0.5"
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rcov
|
72
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: "1.0"
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *id006
|
81
|
+
description: Allows taskmapper to interact with Your System.
|
82
|
+
email: rafael@hybridgroup.com
|
83
|
+
executables: []
|
84
|
+
|
85
|
+
extensions: []
|
86
|
+
|
87
|
+
extra_rdoc_files:
|
88
|
+
- LICENSE
|
89
|
+
- README.md
|
90
|
+
files:
|
91
|
+
- .DS_Store
|
92
|
+
- .rbenv-gemsets
|
93
|
+
- .rvmrc
|
94
|
+
- .travis.yml
|
95
|
+
- Gemfile
|
96
|
+
- Gemfile.lock
|
97
|
+
- LICENSE
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- VERSION
|
101
|
+
- lib/.DS_Store
|
102
|
+
- lib/provider/comment.rb
|
103
|
+
- lib/provider/project.rb
|
104
|
+
- lib/provider/ticket.rb
|
105
|
+
- lib/provider/zendesk.rb
|
106
|
+
- lib/taskmapper-zendesk.rb
|
107
|
+
- lib/zendesk/zendesk-api.rb
|
108
|
+
- spec/.DS_Store
|
109
|
+
- spec/comments_spec.rb
|
110
|
+
- spec/fixtures/.DS_Store
|
111
|
+
- spec/fixtures/ticket.json
|
112
|
+
- spec/fixtures/tickets.json
|
113
|
+
- spec/fixtures/tickets.xml
|
114
|
+
- spec/fixtures/tickets/2.xml
|
115
|
+
- spec/fixtures/tickets/5.xml
|
116
|
+
- spec/fixtures/tickets/create.xml
|
117
|
+
- spec/fixtures/users/55030073.json
|
118
|
+
- spec/projects_spec.rb
|
119
|
+
- spec/spec.opts
|
120
|
+
- spec/spec_helper.rb
|
121
|
+
- spec/taskmapper-zendesk_spec.rb
|
122
|
+
- spec/tickets_spec.rb
|
123
|
+
- taskmapper-zendesk.gemspec
|
124
|
+
homepage: http://github.com/hybridgroup/taskmapper-zendesk
|
125
|
+
licenses: []
|
126
|
+
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: "0"
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: "0"
|
144
|
+
requirements: []
|
145
|
+
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 1.8.17
|
148
|
+
signing_key:
|
149
|
+
specification_version: 3
|
150
|
+
summary: taskmapper Provider for Zendesk
|
151
|
+
test_files: []
|
152
|
+
|