Commit 329fd76358172cc32531dc7865f9305dec11c3f7
1 parent
ff47b46d
Exists in
master
and in
29 other branches
blog: fixes duplication of blog image cover in blog page
Fixes #150
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
app/views/content_viewer/view_page.html.erb
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | <% cache(@page.cache_key(params, user, language)) do %> |
32 | 32 | <div class="<%="article-body article-body-" + @page.css_class_name %>"> |
33 | 33 | <% options = @page.image? ? {:gallery_view => true} : {} %> |
34 | - <% if @page.image.present? && !@page.event? %> | |
34 | + <% if @page.image.present? && !@page.event? && !@page.blog? %> | |
35 | 35 | <div class="article-body-img"> |
36 | 36 | <%= image_tag(@page.image.public_filename) %> |
37 | 37 | <p><%= @page.image.label%></p> | ... | ... |
test/functional/content_viewer_controller_test.rb
... | ... | @@ -1616,4 +1616,14 @@ class ContentViewerControllerTest < ActionController::TestCase |
1616 | 1616 | page.reload |
1617 | 1617 | assert_equal 1, page.hits |
1618 | 1618 | end |
1619 | + | |
1620 | + should 'show blog image only inside blog cover' do | |
1621 | + blog = create(Blog, :profile_id => profile.id, :name=>'testblog', :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}) | |
1622 | + blog.save! | |
1623 | + get :view_page, :profile => profile.identifier, :page => [blog.path] | |
1624 | + | |
1625 | + assert_select '.blog-cover > img', 1 | |
1626 | + assert_select '.article-body-img > img', 0 | |
1627 | + end | |
1628 | + | |
1619 | 1629 | end | ... | ... |