Merge pull request #2899 from papayalabs/2980-hide-featured-section-with-no-cards

Hide Featured section on Home Page if there are no cards
This commit is contained in:
Javier Martín
2018-12-10 12:55:32 +01:00
committed by GitHub
2 changed files with 25 additions and 3 deletions

View File

@@ -20,9 +20,11 @@
<div class="row">
<div class="small-12 column <%= 'large-8' if feed_processes_enabled? %>">
<%= render "cards" %>
</div>
<% if @cards.any? %>
<div class="small-12 column <%= 'large-8' if feed_processes_enabled? %>">
<%= render "cards" %>
</div>
<% end %>
<div class="small-12 large-4 column">
<%= render "processes" %>

View File

@@ -143,4 +143,24 @@ feature "Home" do
"/html/body/div[@class='wrapper ']/comment()[contains(.,'ie-callout')]"
end
end
scenario 'if there are cards, the "featured" title will render' do
card = create(:widget_card,
title: "Card text",
description: "Card description",
link_text: "Link text",
link_url: "consul.dev"
)
visit root_path
expect(page).to have_css(".title", text: "Featured")
end
scenario 'if there are no cards, the "featured" title will not render' do
visit root_path
expect(page).not_to have_css(".title", text: "Featured")
end
end