zendesk_api 1.4.5 → 1.4.6

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: a7021e19badde0fd416969c1bc4be207caaf5834
4
- data.tar.gz: ea01dab8e9c693b241f54f5041d2c7ce99f9a8a9
3
+ metadata.gz: f557c57b4ab53937a0fbdb507af1c295d721c0c2
4
+ data.tar.gz: 50eaa76f1935838f5d69fc37587f559878f4ee41
5
5
  SHA512:
6
- metadata.gz: 6d873f7e34fded76987026be01fa1150d04985928c1a56a349f8e58aabe3fcbc00af0d1e5cafdaaa7bad4833bc60775b26d3d5892559377b0c30633353478397
7
- data.tar.gz: a1237c1049bcafe8331e6ed6e2e1c7eeeaf88c6ce59e548e874035dd2ff72e823c0f89e3534a01f164a8d83971d1a09ec198af63a4159b914fd71745ffbe732b
6
+ metadata.gz: f76fa5e165fe58e7f4f80f267b3cb3553744a06493189ff37cb87021fad6d9587c58f22cac030ed679f35a354bf19d70db0d16c921576668a79adaf346614813
7
+ data.tar.gz: fa2ea713cc8f63752d8b2a75da77ae75ca04934bf556ae649aa29e67846d674a8721ff723a78356103a27e3273f5b81fb011b5775c7f5fdd0cdf1d1177c6cf20
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zendesk_api (1.4.5)
4
+ zendesk_api (1.4.6)
5
5
  faraday (~> 0.9)
6
6
  hashie (>= 1.2, < 4.0)
7
7
  inflection
@@ -163,6 +163,8 @@ module ZendeskAPI
163
163
  include Update
164
164
  include Destroy
165
165
 
166
+ has_many :uploads, :class => Attachment, :inline => true
167
+
166
168
  def self.import!(client, attributes)
167
169
  new(client, attributes).tap do |comment|
168
170
  comment.save!(:path => 'import/' + comment.path)
@@ -192,6 +194,8 @@ module ZendeskAPI
192
194
  has_many :subscriptions, :class => TopicSubscription
193
195
  has :vote, :class => TopicVote
194
196
  has_many Tag, :extend => Tag::Update, :inline => :create
197
+ has_many Attachment
198
+ has_many :uploads, :class => Attachment, :inline => true
195
199
 
196
200
  def votes(opts = {})
197
201
  return @votes if @votes && !opts[:reload]
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.4.5"
2
+ VERSION = "1.4.6"
3
3
  end
@@ -100,9 +100,9 @@ module ZendeskAPI
100
100
  end
101
101
 
102
102
  def dynamic_content_item
103
- VCR.use_cassette('valid_brand') do
103
+ VCR.use_cassette('valid_dynamic_content') do
104
104
  @item ||= client.dynamic_content.items.first
105
- @item ||= client.dynamic_content.items.create!(:name => 'Test Item', :content => 'Testing')
105
+ @item ||= client.dynamic_content.items.create!(:name => 'Test Item', :content => 'Testing', :default_locale_id => 1)
106
106
  end
107
107
  end
108
108
  end
@@ -27,6 +27,18 @@ describe ZendeskAPI::Topic::TopicComment do
27
27
  end
28
28
  end
29
29
  end
30
+
31
+ it "can upload while creating" do
32
+ VCR.use_cassette("topic_comment_inline_uploads") do
33
+ comment = ZendeskAPI::Topic::TopicComment.new(client, valid_attributes.merge(:topic_id => topic.id))
34
+ comment.uploads << "spec/fixtures/Argentina.gif"
35
+ comment.uploads << File.new("spec/fixtures/Argentina.gif")
36
+
37
+ comment.save!
38
+ expect(comment.changes).to eq({}) # uploads were set before save
39
+ expect(comment.attributes[:uploads].map(&:class)).to eq([String, String]) # upload was sent as tokens
40
+ end
41
+ end
30
42
  end
31
43
 
32
44
  describe ZendeskAPI::User::TopicComment do
@@ -31,4 +31,16 @@ describe ZendeskAPI::Topic do
31
31
  end
32
32
  end
33
33
  end
34
+
35
+ it "can upload while creating" do
36
+ VCR.use_cassette("topic_inline_uploads") do
37
+ topic = ZendeskAPI::Topic.new(client, valid_attributes)
38
+ topic.uploads << "spec/fixtures/Argentina.gif"
39
+ topic.uploads << File.new("spec/fixtures/Argentina.gif")
40
+
41
+ topic.save!
42
+ expect(topic.changes).to eq({}) # uploads were set before save
43
+ expect(topic.attributes[:uploads].map(&:class)).to eq([String, String]) # upload was sent as tokens
44
+ end
45
+ end
34
46
  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.5
4
+ version: 1.4.6
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-10-16 00:00:00.000000000 Z
12
+ date: 2014-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bump