Commit 69383c663db002a6b6a611799294eec253baa7c0

Authored by Antonio Terceiro
2 parents 1fb3363c 487508e7

Merge branch 'stable'

app/helpers/cms_helper.rb
... ... @@ -28,7 +28,7 @@ module CmsHelper
28 28 end
29 29  
30 30 def link_to_article(article)
31   - article_name = short_filename(article.name, 30)
  31 + article_name = short_filename(article.title, 30)
32 32 if article.folder?
33 33 link_to article_name, {:action => 'view', :id => article.id}, :class => icon_for_article(article)
34 34 else
... ...
test/functional/cms_controller_test.rb
... ... @@ -1539,4 +1539,16 @@ class CmsControllerTest < Test::Unit::TestCase
1539 1539 assert_tag :tag => 'label', :attributes => { :for => 'article_accept_comments' }, :content => _('I want to receive comments about this article')
1540 1540 end
1541 1541  
  1542 + should 'display filename if uploaded file has not title' do
  1543 + file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => @profile)
  1544 + get :index, :profile => @profile.identifier
  1545 + assert_tag :a, :content => "rails.png"
  1546 + end
  1547 +
  1548 + should 'display title if uploaded file has one' do
  1549 + file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => @profile, :title => 'An image')
  1550 + get :index, :profile => @profile.identifier
  1551 + assert_tag :a, :content => "An image"
  1552 + end
  1553 +
1542 1554 end
... ...