zendesk_api 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +4 -0
- data/lib/zendesk_api/collection.rb +1 -1
- data/lib/zendesk_api/resource.rb +4 -0
- data/lib/zendesk_api/version.rb +1 -1
- data/spec/collection_spec.rb +11 -0
- data/spec/resource_spec.rb +9 -0
- metadata +2 -2
data/Readme.md
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
This client **only** supports Zendesk's v2 API. Please see our [API documentation](http://developer.zendesk.com) for more information.
|
6
6
|
|
7
|
+
## Additional Documentation
|
8
|
+
|
9
|
+
Additional documentation can be found on [rubydoc.info](http://rubydoc.info/gems/zendesk_api/frames)
|
10
|
+
|
7
11
|
## Important Notice
|
8
12
|
|
9
13
|
Version 0.0.5 brings with it a change to the top-level namespace. All references to Zendesk should now use ZendeskAPI.
|
@@ -48,7 +48,7 @@ module ZendeskAPI
|
|
48
48
|
@includes = Array(@options.delete(:include))
|
49
49
|
|
50
50
|
# Used for Attachments, TicketComment
|
51
|
-
if @resource_class.superclass == ZendeskAPI::Data
|
51
|
+
if @resource_class.is_a?(Class) && @resource_class.superclass == ZendeskAPI::Data
|
52
52
|
@resources = []
|
53
53
|
@fetchable = false
|
54
54
|
end
|
data/lib/zendesk_api/resource.rb
CHANGED
data/lib/zendesk_api/version.rb
CHANGED
data/spec/collection_spec.rb
CHANGED
@@ -570,6 +570,17 @@ describe ZendeskAPI::Collection do
|
|
570
570
|
end
|
571
571
|
end
|
572
572
|
|
573
|
+
context "with a module (Search)" do
|
574
|
+
subject { ZendeskAPI::Collection.new(client, ZendeskAPI::Search, :query => "hello") }
|
575
|
+
|
576
|
+
before(:each) do
|
577
|
+
stub_json_request(:get, %r{search\?query=hello}, json(:results => []))
|
578
|
+
end
|
579
|
+
|
580
|
+
it "should not blow up" do
|
581
|
+
subject.to_a.should == []
|
582
|
+
end
|
583
|
+
end
|
573
584
|
|
574
585
|
context "with different path" do
|
575
586
|
subject do
|
data/spec/resource_spec.rb
CHANGED
@@ -328,6 +328,15 @@ describe ZendeskAPI::Resource do
|
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
|
+
context "#to_json" do
|
332
|
+
subject { ZendeskAPI::TestResource.new(client, :id => 1) }
|
333
|
+
|
334
|
+
it "should call #to_json on @attributes" do
|
335
|
+
subject.attributes.should_receive(:to_json)
|
336
|
+
subject.to_json
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
331
340
|
context "#==" do
|
332
341
|
it "is same when id is same" do
|
333
342
|
ZendeskAPI::TestResource.new(client, :id => 1, "bar" => "baz").should == ZendeskAPI::TestResource.new(client, :id => 1, "foo" => "bar")
|
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: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-10-
|
13
|
+
date: 2012-10-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|