zendesk_api 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d2d51cee7bc52d69cb3651b8d34be2f657fd0b0
4
- data.tar.gz: 79d21d20ccc25babe632b13f92e88f63205e119a
3
+ metadata.gz: e08c78d51da14faeccebcd04694a6e70281946a3
4
+ data.tar.gz: 62b948f0e1abd8f218000bc1715bf21f3e76bd6b
5
5
  SHA512:
6
- metadata.gz: 1496843f0c0507408cbf14ccba8fd49b5122502d28bdbf16e40a6e61d02dcfca79eac6dcc8f623ee1bd52157e0588538aee416c53547ad4f45ab6314fe2e5fd8
7
- data.tar.gz: 910905c0701802ad489d7101fbc8de61382b4f4ed3058f0915b148589d4a039e9a9dcd31f9b6b58cd16fd868c630f09b5b82d72fc458254df4314a044f4aecf8
6
+ metadata.gz: 960691a181fa66cfe3fd1ea3859001ec3f13340e93963a962863dd6efaaca24ffff35e0fcf57e936813c8c0006a12e850b40e60dfdf9c498bd9ec0d5cda24a0c
7
+ data.tar.gz: 589a1292ab9fa3d4064346be770c47c1aa46e90136744ecc1d7212f15e1e15877c9cf1a241d95c0c6668d317d5075d05fa44923d089f6b0310c9b74e14f277aa
data/.travis.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  rvm:
2
2
  - ree
3
- - 1.9.2
4
3
  - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
5
6
  - jruby
6
7
  bundler_args: --without=server console
8
+ cache: bundler
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- zendesk_api (1.2.3)
10
+ zendesk_api (1.2.4)
11
11
  faraday (>= 0.8.0)
12
12
  faraday_middleware (>= 0.8.7)
13
13
  hashie (>= 1.2)
data/README.md CHANGED
@@ -386,7 +386,7 @@ ZendeskAPI::App::Installation.destroy!(client, :id => 123)
386
386
 
387
387
  ## Supported Ruby Versions
388
388
 
389
- Tested with Ruby 1.8.7 and 1.9.3
389
+ Tested with Ruby 1.8.7, 1.9.3, 2.0.0, 2.1.0, and jRuby.
390
390
  [![Build Status](https://secure.travis-ci.org/zendesk/zendesk_api_client_rb.png?branch=master)](http://travis-ci.org/zendesk/zendesk_api_client_rb)
391
391
 
392
392
  ## Copyright and license
@@ -328,7 +328,7 @@ module ZendeskAPI
328
328
  result = true
329
329
 
330
330
  @resources.map! do |item|
331
- if item.respond_to?(method) && item.changed?
331
+ if item.respond_to?(method) && !item.destroyed? && item.changed?
332
332
  result &&= item.send(method)
333
333
  end
334
334
 
@@ -52,7 +52,7 @@ module ZendeskAPI
52
52
  return self unless @resources
53
53
 
54
54
  @client.connection.post(path) do |req|
55
- req.body = { :tags => @resources.map(&:id) }
55
+ req.body = { :tags => @resources.reject(&:destroyed?).map(&:id) }
56
56
  end
57
57
 
58
58
  true
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  end
@@ -391,7 +391,7 @@ describe ZendeskAPI::Collection do
391
391
  end
392
392
 
393
393
  context "with a hash" do
394
- let(:object) { mock('ZendeskAPI::TestResource', :changes => [:xxx], :changed? => true) }
394
+ let(:object) { mock('ZendeskAPI::TestResource', :changes => [:xxx], :changed? => true, :destroyed? => false) }
395
395
 
396
396
  it "should call create with those options" do
397
397
  ZendeskAPI::TestResource.should_receive(:new).
@@ -425,7 +425,7 @@ describe ZendeskAPI::Collection do
425
425
 
426
426
  context "with everything else" do
427
427
  it "should pass to new, since this is how attachment handles it" do
428
- attachment = mock(:changes => [:xxx], :changed? => true)
428
+ attachment = mock(:changes => [:xxx], :changed? => true, :destroyed? => false)
429
429
  ZendeskAPI::TestResource.should_receive(:new).
430
430
  with(client, :id => "img.jpg", :association => instance_of(ZendeskAPI::Association)).
431
431
  and_return attachment
@@ -436,6 +436,25 @@ describe ZendeskAPI::Collection do
436
436
  subject.save
437
437
  end
438
438
  end
439
+
440
+ context "with a destroyed object" do
441
+ let(:object) { ZendeskAPI::TestResource.new(client, options) }
442
+
443
+ before(:each) do
444
+ subject << object
445
+ end
446
+
447
+ it "should not save object" do
448
+ object.should_receive(:destroyed?).and_return(true)
449
+ object.should_not_receive(:save)
450
+
451
+ subject.save
452
+ end
453
+
454
+ it "should have object in collection" do
455
+ subject.should include(object)
456
+ end
457
+ end
439
458
  end
440
459
 
441
460
  context "without real data" do
@@ -20,6 +20,13 @@ describe ZendeskAPI::Tag, :vcr, :not_findable do
20
20
  tags.should == %w{tag3}
21
21
  end
22
22
 
23
+ it "shouldn't re-save destroyed tags" do
24
+ parent.tags.first.destroy!
25
+ parent.tags.save!
26
+
27
+ tags.should == %w{tag3}
28
+ end
29
+
23
30
  it "should be updatable" do
24
31
  parent.tags.update!(:id => "tag4")
25
32
 
data/zendesk_api.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.homepage = "http://developer.zendesk.com"
14
14
  s.summary = %q{Zendesk REST API Client}
15
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'
16
+ s.license = 'Apache License Version 2.0'
17
17
 
18
18
  s.required_ruby_version = ">= 1.8.7"
19
19
  s.required_rubygems_version = ">= 1.3.6"
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.2.3
4
+ version: 1.2.4
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-01-12 00:00:00.000000000 Z
12
+ date: 2014-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bump