Displays thumbnails of attached images of the issue view (#1006).

This behaviour can be turned on/off in Settings -> Display (off by default). Thumbnail size can be configured there too.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9933 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-07 13:48:07 +00:00
parent b0bd506201
commit a0c495b953
20 changed files with 253 additions and 7 deletions

View File

@@ -1155,7 +1155,33 @@ class IssuesControllerTest < ActionController::TestCase
end
end
end
def test_show_with_thumbnails_enabled_should_display_thumbnails
@request.session[:user_id] = 2
with_settings :thumbnails_enabled => '1' do
get :show, :id => 14
assert_response :success
end
assert_select 'div.thumbnails' do
assert_select 'a[href=/attachments/16/testfile.png]' do
assert_select 'img[src=/attachments/thumbnail/16]'
end
end
end
def test_show_with_thumbnails_disabled_should_not_display_thumbnails
@request.session[:user_id] = 2
with_settings :thumbnails_enabled => '0' do
get :show, :id => 14
assert_response :success
end
assert_select 'div.thumbnails', 0
end
def test_show_with_multi_custom_field
field = CustomField.find(1)
field.update_attribute :multiple, true