mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 08:46:01 +01:00
Allow attachment thumbnails from REST API (#18707).
git-svn-id: http://svn.redmine.org/redmine/trunk@13806 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -47,6 +47,15 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
|
||||
end
|
||||
end
|
||||
|
||||
test "GET /attachments/:id.xml for image should include thumbnail_url" do
|
||||
get '/attachments/16.xml', {}, credentials('jsmith')
|
||||
assert_response :success
|
||||
assert_equal 'application/xml', @response.content_type
|
||||
assert_select 'attachment id:content(16)' do
|
||||
assert_select '~ thumbnail_url', :text => 'http://www.example.com/attachments/thumbnail/16'
|
||||
end
|
||||
end
|
||||
|
||||
test "GET /attachments/:id.xml should deny access without credentials" do
|
||||
get '/attachments/7.xml'
|
||||
assert_response 401
|
||||
@@ -66,6 +75,12 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
|
||||
set_tmp_attachments_directory
|
||||
end
|
||||
|
||||
test "GET /attachments/thumbnail/:id should return the thumbnail" do
|
||||
skip unless convert_installed?
|
||||
get '/attachments/thumbnail/16', {}, credentials('jsmith')
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "POST /uploads.xml should return the token" do
|
||||
set_tmp_attachments_directory
|
||||
assert_difference 'Attachment.count' do
|
||||
|
||||
Reference in New Issue
Block a user