diff --git a/app/models/product.rb b/app/models/product.rb index f54cdce..6b537b5 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -184,7 +184,7 @@ class Product < ActiveRecord::Base end def price_described? - return false if price.nil? + return false if price.blank? or price == 0 (price - total_production_cost).zero? end diff --git a/features/browse_catalogs.feature b/features/browse_catalogs.feature index d5cbb31..f93f7c7 100644 --- a/features/browse_catalogs.feature +++ b/features/browse_catalogs.feature @@ -73,6 +73,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 not defined + Given the following products + | owner | category | name | + | artebonito | categ1 | Produto1 | + 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 ".no-image" + 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 | diff --git a/features/delete_profile.feature b/features/delete_profile.feature index f443e2e..31b66bf 100644 --- a/features/delete_profile.feature +++ b/features/delete_profile.feature @@ -16,7 +16,7 @@ Feature: delete profile Scenario: deleting profile Given I am logged in as "joaosilva" And I am on Joao Silva's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I follow "Delete profile" Then I should see "Are you sure you want to delete this profile?" When I follow "Yes, I am sure" @@ -32,7 +32,7 @@ Feature: delete profile Scenario: giving up of deleting profile Given I am logged in as "joaosilva" And I am on Joao Silva's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I follow "Delete profile" Then I should see "Are you sure you want to delete this profile?" When I follow "No, I gave up" @@ -108,7 +108,7 @@ Feature: delete profile Scenario: environment admin deletes profile Given I am logged in as admin And I am on Joao Silva's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I follow "Delete profile" Then I should see "Are you sure you want to delete this profile?" When I follow "Yes, I am sure" diff --git a/features/edit_article.feature b/features/edit_article.feature index b80bf05..7e28ae8 100644 --- a/features/edit_article.feature +++ b/features/edit_article.feature @@ -91,7 +91,7 @@ Feature: edit article Given I am on Joao Silva's sitemap When I follow "Save the whales" and wait And I follow "Edit" and wait - And I follow "Cancel" within ".main-block" and wait + And I follow "Cancel" and wait Then I should be on /joaosilva/save-the-whales @selenium diff --git a/features/edit_profile.feature b/features/edit_profile.feature index e83e925..0026a9a 100644 --- a/features/edit_profile.feature +++ b/features/edit_profile.feature @@ -11,7 +11,7 @@ Feature: edit profile | display_name | | birth_date | When I go to joao's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I select "November" And I select "15" And I press "Save" @@ -23,7 +23,7 @@ Feature: edit profile | display_name | | birth_date | When I go to joao's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I select "November" And I select "15" And I press "Save" @@ -35,7 +35,7 @@ Feature: edit profile | display_name | | birth_date | When I go to joao's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I select "November" And I select "15" And I select "1980" @@ -48,7 +48,7 @@ Feature: edit profile | display_name | | birth_date | When I go to joao's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I select "November" And I select "15" And I select "1980" diff --git a/features/manage_product_price_details.feature b/features/manage_product_price_details.feature index 64724fb..a6d0a19 100644 --- a/features/manage_product_price_details.feature +++ b/features/manage_product_price_details.feature @@ -80,7 +80,7 @@ Feature: manage product price details And I should not see "Taxes" within "#display-price-details" And I should see "Energy" within "#display-price-details" - Scenario: not display product detail button if product does not have input + Scenario: not display price composition if product does not have input Given the following product | owner | category | name | | redemoinho | rock | Yellow Submarine | @@ -89,13 +89,12 @@ Feature: manage product price details | mariasouza | Maria Souza | And I am logged in as "mariasouza" When I go to Rede Moinho's page of product Yellow Submarine - And I follow "Price composition" - Then I should not see "Describe here the cost of production" + Then I should not see "Price composition" - Scenario: not display price details if price is not fully described + Scenario: not display price composition if price is not fully described Given I am not logged in And I go to Rede Moinho's page of product Abbey Road - Then I should not see "60.0" + Then I should not see "Price composition" @selenium Scenario: display price details if price is fully described diff --git a/features/signup.feature b/features/signup.feature index df9acb7..c92a4cb 100644 --- a/features/signup.feature +++ b/features/signup.feature @@ -53,7 +53,7 @@ Feature: signup | joaosilva | Joao Silva | Given I am logged in as "joaosilva" And I am on Joao Silva's control panel - And I follow "Profile Info and settings" + And I follow "Edit Profile" And I fill in "Name" with "" When I press "Save" Then I should see "Name can't be blank" -- libgit2 0.21.2