From 6dcb2e05e9c16d127561c4e85d6f3800a2ad537e Mon Sep 17 00:00:00 2001 From: Rafael Martins Date: Sun, 18 Dec 2011 14:56:52 -0200 Subject: [PATCH] Fix: price shouldn't appear when it's $0.00 --- app/views/catalog/index.rhtml | 2 +- features/browse_catalogs.feature | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/views/catalog/index.rhtml b/app/views/catalog/index.rhtml index a0e7ccb..6c65a14 100644 --- a/app/views/catalog/index.rhtml +++ b/app/views/catalog/index.rhtml @@ -25,7 +25,7 @@ <%= _('by ') %> <% end %> - <% unless product.price.blank? %> + <% unless product.price.blank? or product.price == 0 %> <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %> <%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %> diff --git a/features/browse_catalogs.feature b/features/browse_catalogs.feature index 21c76eb..ab0c9e9 100644 --- a/features/browse_catalogs.feature +++ b/features/browse_catalogs.feature @@ -60,6 +60,19 @@ Feature: browse catalogs And I should not see "qualifiers" And I should not see "price composition" + Scenario: don't display the price when it's $0.00 + Given the following products + | owner | category | name | price | + | artebonito | categ1 | Produto1 | 0.00 | + And I am on /catalog/artebonito + Then I should see "Produto1" within "li.product-link" + And I should not see "0.00" + And I should see "No image" within "li.product-big" + And I should not see "product unavailable" + And I should not see "description" + And I should not see "qualifiers" + And I should not see "price composition" + Scenario: product name links to product page Given the following products | owner | category | name | price | -- libgit2 0.21.2