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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/zendesk_api/resources.rb +4 -0
- data/lib/zendesk_api/version.rb +1 -1
- data/spec/fixtures/zendesk.rb +2 -2
- data/spec/live/topic_comment_spec.rb +12 -0
- data/spec/live/topic_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f557c57b4ab53937a0fbdb507af1c295d721c0c2
|
4
|
+
data.tar.gz: 50eaa76f1935838f5d69fc37587f559878f4ee41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f76fa5e165fe58e7f4f80f267b3cb3553744a06493189ff37cb87021fad6d9587c58f22cac030ed679f35a354bf19d70db0d16c921576668a79adaf346614813
|
7
|
+
data.tar.gz: fa2ea713cc8f63752d8b2a75da77ae75ca04934bf556ae649aa29e67846d674a8721ff723a78356103a27e3273f5b81fb011b5775c7f5fdd0cdf1d1177c6cf20
|
data/Gemfile.lock
CHANGED
@@ -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]
|
data/lib/zendesk_api/version.rb
CHANGED
data/spec/fixtures/zendesk.rb
CHANGED
@@ -100,9 +100,9 @@ module ZendeskAPI
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def dynamic_content_item
|
103
|
-
VCR.use_cassette('
|
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
|
data/spec/live/topic_spec.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bump
|