zendesk_api 1.13.1 → 1.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zendesk_api/client.rb +1 -1
- data/lib/zendesk_api/middleware/response/parse_json.rb +0 -1
- data/lib/zendesk_api/version.rb +1 -1
- metadata +10 -205
- data/.gitignore +0 -15
- data/.rspec +0 -2
- data/.travis.yml +0 -10
- data/.yardopts +0 -10
- data/Gemfile +0 -14
- data/LICENSE +0 -176
- data/README.md +0 -425
- data/Rakefile +0 -52
- data/spec/core/association_spec.rb +0 -256
- data/spec/core/bulk_actions_spec.rb +0 -69
- data/spec/core/client_spec.rb +0 -280
- data/spec/core/collection_spec.rb +0 -901
- data/spec/core/configuration_spec.rb +0 -28
- data/spec/core/create_resource_spec.rb +0 -39
- data/spec/core/data_namespace_spec.rb +0 -15
- data/spec/core/data_resource_spec.rb +0 -239
- data/spec/core/inflection_spec.rb +0 -7
- data/spec/core/lru_cache_spec.rb +0 -26
- data/spec/core/middleware/request/encode_json_spec.rb +0 -73
- data/spec/core/middleware/request/etag_cache_spec.rb +0 -21
- data/spec/core/middleware/request/retry_spec.rb +0 -49
- data/spec/core/middleware/request/test.jpg +0 -0
- data/spec/core/middleware/request/upload_spec.rb +0 -164
- data/spec/core/middleware/response/callback_spec.rb +0 -17
- data/spec/core/middleware/response/deflate_spec.rb +0 -21
- data/spec/core/middleware/response/gzip_spec.rb +0 -25
- data/spec/core/middleware/response/parse_iso_dates_spec.rb +0 -44
- data/spec/core/middleware/response/parse_json_spec.rb +0 -53
- data/spec/core/middleware/response/raise_error_spec.rb +0 -128
- data/spec/core/middleware/response/sanitize_response_spec.rb +0 -19
- data/spec/core/read_resource_spec.rb +0 -97
- data/spec/core/resource_spec.rb +0 -541
- data/spec/core/resources/automation_spec.rb +0 -81
- data/spec/core/resources/macro_spec.rb +0 -27
- data/spec/core/resources/trigger_spec.rb +0 -67
- data/spec/core/resources/view_spec.rb +0 -97
- data/spec/core/search_spec.rb +0 -23
- data/spec/core/spec_helper.rb +0 -162
- data/spec/core/trackie_spec.rb +0 -129
- data/spec/fixtures/Argentina.gif +0 -0
- data/spec/fixtures/Argentina2.gif +0 -0
- data/spec/fixtures/credentials.yml.example +0 -3
- data/spec/fixtures/sample_app.zip +0 -0
- data/spec/fixtures/test_resources.rb +0 -22
- data/spec/fixtures/zendesk.rb +0 -109
- data/spec/live/Readme.md +0 -4
- data/spec/live/activity_spec.rb +0 -12
- data/spec/live/app_installation_spec.rb +0 -58
- data/spec/live/app_spec.rb +0 -58
- data/spec/live/audit_spec.rb +0 -15
- data/spec/live/automation_spec.rb +0 -23
- data/spec/live/bookmark_spec.rb +0 -11
- data/spec/live/brand_spec.rb +0 -14
- data/spec/live/category_spec.rb +0 -12
- data/spec/live/collection_spec.rb +0 -64
- data/spec/live/custom_role_spec.rb +0 -5
- data/spec/live/dynamic_content/item_spec.rb +0 -16
- data/spec/live/dynamic_content/variant_spec.rb +0 -19
- data/spec/live/forum_spec.rb +0 -14
- data/spec/live/forum_subscription_spec.rb +0 -12
- data/spec/live/group_membership_spec.rb +0 -18
- data/spec/live/group_spec.rb +0 -32
- data/spec/live/identity_spec.rb +0 -14
- data/spec/live/locale_spec.rb +0 -9
- data/spec/live/macro_spec.rb +0 -44
- data/spec/live/organization_field_spec.rb +0 -12
- data/spec/live/organization_membership_spec.rb +0 -11
- data/spec/live/organization_spec.rb +0 -12
- data/spec/live/push_notification_device_spec.rb +0 -21
- data/spec/live/request_spec.rb +0 -38
- data/spec/live/satisfaction_rating_spec.rb +0 -6
- data/spec/live/setting_spec.rb +0 -25
- data/spec/live/suspended_ticket_spec.rb +0 -8
- data/spec/live/tag_spec.rb +0 -58
- data/spec/live/target_spec.rb +0 -17
- data/spec/live/ticket_field_spec.rb +0 -12
- data/spec/live/ticket_form_spec.rb +0 -14
- data/spec/live/ticket_metrics_spec.rb +0 -6
- data/spec/live/ticket_spec.rb +0 -136
- data/spec/live/topic_comment_spec.rb +0 -52
- data/spec/live/topic_spec.rb +0 -46
- data/spec/live/topic_subscription_spec.rb +0 -12
- data/spec/live/topic_vote_spec.rb +0 -13
- data/spec/live/trigger_spec.rb +0 -23
- data/spec/live/upload_spec.rb +0 -10
- data/spec/live/user_field_spec.rb +0 -12
- data/spec/live/user_spec.rb +0 -71
- data/spec/live/user_view_spec.rb +0 -16
- data/spec/live/view_spec.rb +0 -22
- data/spec/live/voice/phone_number_spec.rb +0 -13
- data/spec/macros/resource_macros.rb +0 -169
- data/zendesk_api.gemspec +0 -38
data/spec/live/user_view_spec.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'core/spec_helper'
|
2
|
-
|
3
|
-
describe ZendeskAPI::UserView, :delete_after do
|
4
|
-
def valid_attributes
|
5
|
-
{
|
6
|
-
:title => "Overseas gold member",
|
7
|
-
:all => [
|
8
|
-
{ field: "name", operator: "is", value: "abcd" },
|
9
|
-
]
|
10
|
-
}
|
11
|
-
end
|
12
|
-
|
13
|
-
it_should_be_readable :user_views
|
14
|
-
it_should_be_creatable
|
15
|
-
it_should_be_deletable
|
16
|
-
end
|
data/spec/live/view_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'core/spec_helper'
|
2
|
-
|
3
|
-
describe ZendeskAPI::View, :delete_after do
|
4
|
-
def valid_attributes
|
5
|
-
{
|
6
|
-
:title => "my test view",
|
7
|
-
:conditions => {
|
8
|
-
:all => [{ :field => "status", :operator => "is", :value => "open" }]
|
9
|
-
}
|
10
|
-
}
|
11
|
-
end
|
12
|
-
|
13
|
-
it_should_be_readable :views
|
14
|
-
it_should_be_readable :views, :active
|
15
|
-
|
16
|
-
it_should_be_creatable
|
17
|
-
it_should_be_updatable :conditions, {
|
18
|
-
"any" => [],
|
19
|
-
"all" => [{ "field" => "status", "operator" => "is", "value" => "solved" }]
|
20
|
-
}
|
21
|
-
it_should_be_deletable
|
22
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'core/spec_helper'
|
2
|
-
|
3
|
-
describe ZendeskAPI::Voice::PhoneNumber, :delete_after do
|
4
|
-
def valid_attributes
|
5
|
-
{:number => "+14434064759", :country_code => "US", :toll_free => "false"}
|
6
|
-
end
|
7
|
-
|
8
|
-
it_should_be_creatable
|
9
|
-
it_should_be_updatable :nickname
|
10
|
-
it_should_be_updatable :transcription
|
11
|
-
it_should_be_updatable :recorded
|
12
|
-
it_should_be_deletable
|
13
|
-
end
|
@@ -1,169 +0,0 @@
|
|
1
|
-
module ResourceMacros
|
2
|
-
def self.extended(klass)
|
3
|
-
klass.send(:define_method, :default_options) {{}}
|
4
|
-
end
|
5
|
-
|
6
|
-
def under(object, &blk)
|
7
|
-
context "under a #{object.class.singular_resource_name}" do
|
8
|
-
let(:parent) { object }
|
9
|
-
|
10
|
-
define_method(:default_options) do
|
11
|
-
{ "#{object.class.singular_resource_name}_id" => object.id }
|
12
|
-
end
|
13
|
-
|
14
|
-
instance_eval(&blk)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def it_should_be_creatable(options={})
|
19
|
-
context "creation", :vcr do
|
20
|
-
subject { described_class }
|
21
|
-
|
22
|
-
before(:all) do
|
23
|
-
VCR.use_cassette("#{described_class.to_s}_create") do
|
24
|
-
@object = described_class.create(client, valid_attributes.merge(default_options))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should have an id" do
|
29
|
-
expect(@object).to_not be_nil
|
30
|
-
expect(@object.send(:id)).to_not be_nil
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should be findable", :unless => metadata[:not_findable] do
|
34
|
-
options = default_options
|
35
|
-
options.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
36
|
-
expect(described_class.find(client, options)).to eq(@object)
|
37
|
-
end
|
38
|
-
|
39
|
-
after(:all) do
|
40
|
-
VCR.use_cassette("#{described_class.to_s}_create_delete") do
|
41
|
-
@object.destroy
|
42
|
-
end
|
43
|
-
end if metadata[:delete_after]
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def it_should_be_updatable(attribute, value = "TESTDATA", extra = {})
|
48
|
-
context "update", :vcr do
|
49
|
-
before(:all) do
|
50
|
-
VCR.use_cassette("#{described_class.to_s}_update_create") do
|
51
|
-
@object = described_class.create(client, valid_attributes.merge(default_options))
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
before(:each) do
|
56
|
-
@object.send("#{attribute}=", value)
|
57
|
-
extra.each {|k, v| @object.send("#{k}=", v)}
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should be savable" do
|
61
|
-
expect(@object.save).to be(true)
|
62
|
-
end
|
63
|
-
|
64
|
-
context "after save" do
|
65
|
-
before(:each) do
|
66
|
-
@object.save
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should keep attributes" do
|
70
|
-
expect(@object.send(attribute)).to eq(value)
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should be findable", :unless => metadata[:not_findable] do
|
74
|
-
options = default_options
|
75
|
-
options.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
76
|
-
expect(described_class.find(client, options)).to eq(@object)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
after(:all) do
|
81
|
-
VCR.use_cassette("#{described_class.to_s}_update_delete") do
|
82
|
-
@object.destroy
|
83
|
-
end
|
84
|
-
end if metadata[:delete_after]
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def it_should_be_deletable(options = {})
|
89
|
-
context "deletion", :vcr do
|
90
|
-
before(:all) do
|
91
|
-
if options[:object]
|
92
|
-
@object = options.delete(:object)
|
93
|
-
else
|
94
|
-
VCR.use_cassette("#{described_class.to_s}_delete_create") do
|
95
|
-
@object = described_class.create(client, valid_attributes.merge(default_options))
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
it "should be destroyable" do |example|
|
101
|
-
expect(@object.destroy).to be(true)
|
102
|
-
expect(@object.destroyed?).to be(true)
|
103
|
-
|
104
|
-
if (!options.key?(:find) || options[:find]) && !example.metadata[:not_findable]
|
105
|
-
opts = default_options
|
106
|
-
opts.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
107
|
-
obj = described_class.find(client, opts)
|
108
|
-
|
109
|
-
if options[:find]
|
110
|
-
expect(obj.send(options[:find].first)).to eq(options[:find].last)
|
111
|
-
else
|
112
|
-
expect(obj).to be_nil
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
def it_should_be_readable(*args)
|
120
|
-
options = args.last.is_a?(Hash) ? args.pop : {}
|
121
|
-
create = !!options.delete(:create)
|
122
|
-
klass = args.first.is_a?(ZendeskAPI::DataResource) ? args.shift : client
|
123
|
-
context_name = "read_#{klass.class}_#{args.join("_")}"
|
124
|
-
|
125
|
-
context context_name, :vcr do
|
126
|
-
before(:all) do
|
127
|
-
VCR.use_cassette("#{described_class.to_s}_#{context_name}_create") do
|
128
|
-
@object = described_class.create!(client, valid_attributes.merge(default_options))
|
129
|
-
end
|
130
|
-
end if create
|
131
|
-
|
132
|
-
after(:all) do
|
133
|
-
VCR.use_cassette("#{described_class.to_s}_#{context_name}_delete") do
|
134
|
-
@object.destroy
|
135
|
-
end
|
136
|
-
end if create
|
137
|
-
|
138
|
-
it "should be findable" do |example|
|
139
|
-
result = klass
|
140
|
-
args.each {|a| result = result.send(a, options) }
|
141
|
-
|
142
|
-
if result.is_a?(ZendeskAPI::Collection)
|
143
|
-
if create
|
144
|
-
object = nil
|
145
|
-
|
146
|
-
result.all do |o|
|
147
|
-
object = o if @object == o
|
148
|
-
end
|
149
|
-
|
150
|
-
expect(object).to_not be_nil
|
151
|
-
else
|
152
|
-
expect(result.fetch(true)).to_not be_empty
|
153
|
-
object = result.first
|
154
|
-
end
|
155
|
-
else
|
156
|
-
expect(result).to_not be_nil
|
157
|
-
expect(result).to eq(@object) if create
|
158
|
-
object = result
|
159
|
-
end
|
160
|
-
|
161
|
-
if described_class.respond_to?(:find) && !example.metadata[:not_findable]
|
162
|
-
options = default_options
|
163
|
-
options.merge!(:id => object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
164
|
-
expect(described_class.find(client, options)).to_not be_nil
|
165
|
-
end
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|
169
|
-
end
|
data/zendesk_api.gemspec
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib/', __FILE__)
|
3
|
-
$:.unshift lib unless $:.include?(lib)
|
4
|
-
|
5
|
-
require 'zendesk_api/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "zendesk_api"
|
9
|
-
s.version = ZendeskAPI::VERSION
|
10
|
-
s.platform = Gem::Platform::RUBY
|
11
|
-
s.authors = ["Steven Davidovitz", "Michael Grosser"]
|
12
|
-
s.email = ["support@zendesk.com"]
|
13
|
-
s.homepage = "http://developer.zendesk.com"
|
14
|
-
s.summary = %q{Zendesk REST API Client}
|
15
|
-
s.description = %q{Ruby wrapper for the REST API at http://www.zendesk.com. Documentation at http://developer.zendesk.com.}
|
16
|
-
s.license = 'Apache License Version 2.0'
|
17
|
-
|
18
|
-
s.required_ruby_version = ">= 1.9.0"
|
19
|
-
s.required_rubygems_version = ">= 1.3.6"
|
20
|
-
|
21
|
-
s.add_development_dependency "bump"
|
22
|
-
s.add_development_dependency "rake"
|
23
|
-
s.add_development_dependency "rspec"
|
24
|
-
s.add_development_dependency "vcr"
|
25
|
-
s.add_development_dependency "webmock"
|
26
|
-
s.add_development_dependency "yard"
|
27
|
-
|
28
|
-
s.add_runtime_dependency "faraday", "~> 0.9"
|
29
|
-
s.add_runtime_dependency "hashie", ">= 1.2", "< 4.0", "!= 3.3.0"
|
30
|
-
s.add_runtime_dependency "inflection"
|
31
|
-
s.add_runtime_dependency "multipart-post", "~> 2.0"
|
32
|
-
s.add_runtime_dependency "mime-types"
|
33
|
-
s.add_runtime_dependency "scrub_rb", "~> 1.0.1"
|
34
|
-
|
35
|
-
s.files = `git ls-files -x Gemfile.lock`.split("\n") rescue ''
|
36
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
37
|
-
s.require_paths = ["lib"]
|
38
|
-
end
|