Commit 6dcb2e05e9c16d127561c4e85d6f3800a2ad537e

Authored by Rafael Martins
1 parent c635810b

Fix: price shouldn't appear when it's $0.00

app/views/catalog/index.rhtml
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <span class="product-discount-by"><%= _('by ') %></span> 25 <span class="product-discount-by"><%= _('by ') %></span>
26 </span> 26 </span>
27 <% end %> 27 <% end %>
28 - <% unless product.price.blank? %> 28 + <% unless product.price.blank? or product.price == 0 %>
29 <span class="product-price"> 29 <span class="product-price">
30 <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %> 30 <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %>
31 <span class="product-unit"><%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %></span> 31 <span class="product-unit"><%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %></span>
features/browse_catalogs.feature
@@ -60,6 +60,19 @@ Feature: browse catalogs @@ -60,6 +60,19 @@ Feature: browse catalogs
60 And I should not see "qualifiers" 60 And I should not see "qualifiers"
61 And I should not see "price composition" 61 And I should not see "price composition"
62 62
  63 + Scenario: don't display the price when it's $0.00
  64 + Given the following products
  65 + | owner | category | name | price |
  66 + | artebonito | categ1 | Produto1 | 0.00 |
  67 + And I am on /catalog/artebonito
  68 + Then I should see "Produto1" within "li.product-link"
  69 + And I should not see "0.00"
  70 + And I should see "No image" within "li.product-big"
  71 + And I should not see "product unavailable"
  72 + And I should not see "description"
  73 + And I should not see "qualifiers"
  74 + And I should not see "price composition"
  75 +
63 Scenario: product name links to product page 76 Scenario: product name links to product page
64 Given the following products 77 Given the following products
65 | owner | category | name | price | 78 | owner | category | name | price |