zendesk_api 1.3.9 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +31 -21
- data/lib/zendesk_api/collection.rb +7 -0
- data/lib/zendesk_api/version.rb +1 -1
- data/spec/core/association_spec.rb +40 -40
- data/spec/core/client_spec.rb +37 -37
- data/spec/core/collection_spec.rb +81 -70
- data/spec/core/configuration_spec.rb +4 -4
- data/spec/core/create_resource_spec.rb +2 -2
- data/spec/core/data_resource_spec.rb +28 -28
- data/spec/core/inflection_spec.rb +1 -1
- data/spec/core/lru_cache_spec.rb +8 -8
- data/spec/core/middleware/request/encode_json_spec.rb +8 -8
- data/spec/core/middleware/request/etag_cache_spec.rb +5 -5
- data/spec/core/middleware/request/retry_spec.rb +10 -8
- data/spec/core/middleware/request/upload_spec.rb +25 -25
- data/spec/core/middleware/response/callback_spec.rb +1 -1
- data/spec/core/middleware/response/deflate_spec.rb +1 -1
- data/spec/core/middleware/response/gzip_spec.rb +1 -1
- data/spec/core/middleware/response/parse_iso_dates_spec.rb +9 -9
- data/spec/core/middleware/response/parse_json_spec.rb +4 -4
- data/spec/core/middleware/response/raise_error_spec.rb +2 -2
- data/spec/core/read_resource_spec.rb +6 -6
- data/spec/core/resource_spec.rb +66 -66
- data/spec/core/search_spec.rb +3 -3
- data/spec/core/spec_helper.rb +5 -4
- data/spec/core/trackie_spec.rb +17 -17
- data/spec/live/app_installation_spec.rb +2 -2
- data/spec/live/app_spec.rb +1 -1
- data/spec/live/audit_spec.rb +2 -2
- data/spec/live/collection_spec.rb +8 -8
- data/spec/live/locale_spec.rb +1 -1
- data/spec/live/macro_spec.rb +4 -4
- data/spec/live/setting_spec.rb +1 -1
- data/spec/live/tag_spec.rb +7 -7
- data/spec/live/ticket_spec.rb +10 -10
- data/spec/live/topic_comment_spec.rb +2 -2
- data/spec/live/topic_spec.rb +2 -2
- data/spec/live/user_spec.rb +15 -15
- data/spec/macros/resource_macros.rb +17 -17
- metadata +2 -2
@@ -26,15 +26,15 @@ module ResourceMacros
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should have an id" do
|
29
|
-
@object.
|
30
|
-
@object.send(:id).
|
29
|
+
expect(@object).to_not be_nil
|
30
|
+
expect(@object.send(:id)).to_not be_nil
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should be findable", :unless => metadata[:not_findable] do
|
34
34
|
options = default_options
|
35
35
|
options.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
36
|
-
described_class.find(client, options).
|
37
|
-
end
|
36
|
+
expect(described_class.find(client, options)).to eq(@object)
|
37
|
+
end
|
38
38
|
|
39
39
|
after(:all) do
|
40
40
|
VCR.use_cassette("#{described_class.to_s}_create_delete") do
|
@@ -57,7 +57,7 @@ module ResourceMacros
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it "should be savable" do
|
60
|
-
@object.save.
|
60
|
+
expect(@object.save).to be(true)
|
61
61
|
end
|
62
62
|
|
63
63
|
context "after save" do
|
@@ -66,14 +66,14 @@ module ResourceMacros
|
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should keep attributes" do
|
69
|
-
@object.send(attribute).
|
69
|
+
expect(@object.send(attribute)).to eq(value )
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should be findable", :unless => metadata[:not_findable] do
|
73
73
|
options = default_options
|
74
74
|
options.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
75
|
-
described_class.find(client, options).
|
76
|
-
end
|
75
|
+
expect(described_class.find(client, options)).to eq(@object)
|
76
|
+
end
|
77
77
|
end
|
78
78
|
|
79
79
|
after(:all) do
|
@@ -97,8 +97,8 @@ module ResourceMacros
|
|
97
97
|
end
|
98
98
|
|
99
99
|
it "should be destroyable" do
|
100
|
-
@object.destroy.
|
101
|
-
@object.destroyed
|
100
|
+
expect(@object.destroy).to be(true)
|
101
|
+
expect(@object.destroyed?).to be(true)
|
102
102
|
|
103
103
|
if (!options.key?(:find) || options[:find]) && !example.metadata[:not_findable]
|
104
104
|
opts = default_options
|
@@ -106,9 +106,9 @@ module ResourceMacros
|
|
106
106
|
obj = silence_logger{ described_class.find(client, opts) }
|
107
107
|
|
108
108
|
if options[:find]
|
109
|
-
obj.send(options[:find].first).
|
109
|
+
expect(obj.send(options[:find].first)).to eq(options[:find].last)
|
110
110
|
else
|
111
|
-
obj.
|
111
|
+
expect(obj).to be_nil
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -139,19 +139,19 @@ module ResourceMacros
|
|
139
139
|
args.each {|a| result = result.send(a, options) }
|
140
140
|
|
141
141
|
if result.is_a?(ZendeskAPI::Collection)
|
142
|
-
result.fetch(true).
|
143
|
-
result.fetch.
|
142
|
+
expect(result.fetch(true)).to_not be_empty
|
143
|
+
expect(result.fetch).to include(@object) if create
|
144
144
|
object = result.first
|
145
145
|
else
|
146
|
-
result.
|
147
|
-
result.
|
146
|
+
expect(result).to_not be_nil
|
147
|
+
expect(result).to eq(@object) if create
|
148
148
|
object = result
|
149
149
|
end
|
150
150
|
|
151
151
|
if described_class.respond_to?(:find) && !example.metadata[:not_findable]
|
152
152
|
options = default_options
|
153
153
|
options.merge!(:id => object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
|
154
|
-
described_class.find(client, options).
|
154
|
+
expect(described_class.find(client, options)).to_not be_nil
|
155
155
|
end
|
156
156
|
end
|
157
157
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Davidovitz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bump
|