live/ticket_spec.rb in zendesk_api-0.0.9 vs live/ticket_spec.rb in zendesk_api-0.1.1
- old
+ new
@@ -3,11 +3,11 @@
describe ZendeskAPI::Ticket do
def valid_attributes
{
:type => "question",
:subject => "This is a question?",
- :description => "Indeed it is!",
+ :comment => { :value => "Indeed it is!" },
:priority => "normal",
:requester_id => user.id,
:submitter_id => user.id
}
end
@@ -64,15 +64,15 @@
end
it "can upload while creating" do
VCR.use_cassette("ticket_inline_uploads") do
ticket = ZendeskAPI::Ticket.new(client, valid_attributes.merge(default_options))
- ticket.uploads << "spec/fixtures/Argentina.gif"
- #ticket.uploads << File.new("spec/fixtures/Argentina.gif") # TODO ZendeskAPI bug: you can only upload 1 picture at a time
+ ticket.comment.uploads << "spec/fixtures/Argentina.gif"
+ ticket.comment.uploads << File.new("spec/fixtures/Argentina.gif")
ticket.save!
- ticket.changes.should == {} # uploads where set before save
- ticket.attributes[:uploads].map(&:class).should == [String] # upload was sent as tokens
+ ticket.changes.should == {} # uploads were set before save
+ ticket.comment.attributes[:uploads].map(&:class).should == [String, String] # upload was sent as tokens
end
end
it "can comment while creating" do
VCR.use_cassette("ticket_inline_comments") do