Commit 69383c663db002a6b6a611799294eec253baa7c0
Exists in
master
and in
29 other branches
Merge branch 'stable'
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
app/helpers/cms_helper.rb
@@ -28,7 +28,7 @@ module CmsHelper | @@ -28,7 +28,7 @@ module CmsHelper | ||
28 | end | 28 | end |
29 | 29 | ||
30 | def link_to_article(article) | 30 | def link_to_article(article) |
31 | - article_name = short_filename(article.name, 30) | 31 | + article_name = short_filename(article.title, 30) |
32 | if article.folder? | 32 | if article.folder? |
33 | link_to article_name, {:action => 'view', :id => article.id}, :class => icon_for_article(article) | 33 | link_to article_name, {:action => 'view', :id => article.id}, :class => icon_for_article(article) |
34 | else | 34 | else |
test/functional/cms_controller_test.rb
@@ -1539,4 +1539,16 @@ class CmsControllerTest < Test::Unit::TestCase | @@ -1539,4 +1539,16 @@ class CmsControllerTest < Test::Unit::TestCase | ||
1539 | assert_tag :tag => 'label', :attributes => { :for => 'article_accept_comments' }, :content => _('I want to receive comments about this article') | 1539 | assert_tag :tag => 'label', :attributes => { :for => 'article_accept_comments' }, :content => _('I want to receive comments about this article') |
1540 | end | 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 | end | 1554 | end |