Mercurial > hg > soundsoftware-site
comparison test/integration/api_test/attachments_test.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
85 xml = Hash.from_xml(response.body) | 85 xml = Hash.from_xml(response.body) |
86 assert_kind_of Hash, xml['upload'] | 86 assert_kind_of Hash, xml['upload'] |
87 token = xml['upload']['token'] | 87 token = xml['upload']['token'] |
88 assert_not_nil token | 88 assert_not_nil token |
89 | 89 |
90 attachment = Attachment.first(:order => 'id DESC') | 90 attachment = Attachment.order('id DESC').first |
91 assert_equal token, attachment.token | 91 assert_equal token, attachment.token |
92 assert_nil attachment.container | 92 assert_nil attachment.container |
93 assert_equal 2, attachment.author_id | 93 assert_equal 2, attachment.author_id |
94 assert_equal 'File content'.size, attachment.filesize | 94 assert_equal 'File content'.size, attachment.filesize |
95 assert attachment.content_type.blank? | 95 assert attachment.content_type.blank? |
110 json = ActiveSupport::JSON.decode(response.body) | 110 json = ActiveSupport::JSON.decode(response.body) |
111 assert_kind_of Hash, json['upload'] | 111 assert_kind_of Hash, json['upload'] |
112 token = json['upload']['token'] | 112 token = json['upload']['token'] |
113 assert_not_nil token | 113 assert_not_nil token |
114 | 114 |
115 attachment = Attachment.first(:order => 'id DESC') | 115 attachment = Attachment.order('id DESC').first |
116 assert_equal token, attachment.token | 116 assert_equal token, attachment.token |
117 end | 117 end |
118 | 118 |
119 test "POST /uploads.xml should accept :filename param as the attachment filename" do | 119 test "POST /uploads.xml should accept :filename param as the attachment filename" do |
120 set_tmp_attachments_directory | 120 set_tmp_attachments_directory |