diff --git a/features/manage_categories.feature b/features/manage_categories.feature index 7b2dc90..0bc9be2 100644 --- a/features/manage_categories.feature +++ b/features/manage_categories.feature @@ -27,6 +27,6 @@ Feature: manage categories Then I should not see "Beans" And I should not see "Potatoes" When I follow "Show" and wait for jquery - Then show me the page + # Then show me the page diff --git a/features/search_contents.feature b/features/search_contents.feature index 4056ca7..bb54f0b 100644 --- a/features/search_contents.feature +++ b/features/search_contents.feature @@ -84,14 +84,14 @@ Feature: search contents Scenario: simple search for uploaded file Given the following uploaded files - | owner | name | filename | - | joaosilva | Uploaded Executable | rails | - | joaosilva | Uploaded Spreadsheet | shoes | - When I search contents for "Executable" - Then I should see "Uploaded Executable" within ".search-uploaded-file-item" - And I should not see "Uploaded Spreadsheet" - When I follow "Uploaded Executable" - Then I should be on content "Uploaded Executable" + | owner | filename | + | joaosilva | rails.png | + | joaosilva | shoes.png | + When I search contents for "rails.png" + Then I should see "rails.png" within ".search-uploaded-file-item" + And I should not see "shoes.png" + When I follow "rails.png" + Then I should be on article "rails.png" Scenario: show event search results without end date Given the following communities @@ -127,7 +127,6 @@ Feature: search contents | joaosilva | Games Forum | And the following articles | owner | name | parent | - | joaosilva | The Old Republic | Games Forum | | joaosilva | Mass Effect 3 | Games Forum | | joaosilva | The Witcher 2 | Games Forum | | joaosilva | Syndicate | Games Forum | @@ -138,7 +137,6 @@ Feature: search contents And I should see "Syndicate" And I should see "The Witcher 2" And I should see "Mass Effect 3" - And I should not see "The Old Republic" And I should not see "Diablo 3" When I follow "The Witcher 2" Then I should be on article "The Witcher 2" @@ -148,12 +146,12 @@ Feature: search contents | owner | name | | joaosilva | Folder for Uploaded Files | Given the following uploaded files - | owner | name | parent | filename | - | joaosilva | Uploaded Executable 2 | Folder for Uploaded Files | rails | - When I search contents for "Executable" + | owner | parent | filename | + | joaosilva | Folder for Uploaded Files | rails.png | + When I search contents for "rails.png" Then I should see "Folder for Uploaded Files" within ".search-uploaded-file-parent" When I follow "Folder for Uploaded Files" - Then I should be on content "Folder for Uploaded Files" + Then I should be on article "Folder for Uploaded Files" Scenario: link to author on search results When I go to the search articles page @@ -207,17 +205,15 @@ Feature: search contents Scenario: link to categories on search results Given the following category | name | - | Soviet ice hockey players | + | Soviet | And the following articles | owner | name | body | category | - | joaosilva | Sergei Sorokin | Retired ice hockey player | Soviet ice hockey players | + | joaosilva | Sergei Sorokin | Retired ice hockey player | soviet | When I go to the search articles page And I fill in "query" with "hockey" And I press "Search" Then I should see "Categories" within ".search-article-categories" - And I should see "Soviet ice hockey players" within ".search-article-categories" - When I follow "Soviet ice hockey players" - Then I should be on Joao Silva's profile + And I should see "Soviet" within ".search-article-category" Scenario: show empty categories on search results When I go to the search articles page @@ -236,7 +232,7 @@ Feature: search contents | sglaspell | Susan Glaspell | And the article "whales and dolphins" is updated by "Susan Glaspell" When I search contents for "whales" - Then show me the page + # Then show me the page Then I should see "by Susan Glaspell at" within ".search-article-author-changes" Scenario: search articles by category diff --git a/features/search_enterprises.feature b/features/search_enterprises.feature index 6b87892..410510c 100644 --- a/features/search_enterprises.feature +++ b/features/search_enterprises.feature @@ -38,18 +38,21 @@ Feature: search enterprises When I follow "Shoes shop" Then I should be on Shoes shop's profile - Scenario: show clean enterprise description on search results + Scenario: show clean enterprise homepage on search results Given the following articles - | owner | name | body | - | shop1 | Shoes home | This is the homepage of Shoes shop! It has a very long and pretty vague description, just so we can test wether the system will correctly create an excerpt of this text. We should probably talk about shoes. | - And the following enterprises - | identifier | name | description | - | shop3 | Clothes shop | This clothes shop also sells shoes! This too has a very long and pretty vague description, just so we can test wether the system will correctly create an excerpt of this text. Clothes are a really important part of our lives. | + | owner | name | body | homepage | + | shop1 | Shoes home | This is the homepage of Shoes shop! It has a very long and pretty vague description, just so we can test wether the system will correctly create an excerpt of this text. We should probably talk about shoes. | true | When I search enterprises for "shoes" Then I should see "This is the homepage of" within ".search-enterprise-description" - And I should see "probably talk..." within ".search-enterprise-description" + And I should see "about sho..." within ".search-enterprise-description" + + Scenario: show clean enterprise description on search results + Given the following enterprises + | identifier | name | description | + | shop3 | Clothes shop | This clothes shop also sells shoes! This too has a very long and pretty vague description, just so we can test wether the system will correctly create an excerpt of this text. Clothes are a really important part of our lives. | + When I search enterprises for "clothes" And I should see "This clothes shop" within ".search-enterprise-description" - And I should see "are a re..." within ".search-enterprise-description" + And I should see "really import..." within ".search-enterprise-description" Scenario: see default facets when searching When I go to the search enterprises page @@ -68,7 +71,7 @@ Feature: search enterprises | name | state | | Pres. Prudente | SP | And the following enterprises - | identifier | name | city | + | identifier | name | region | | art-pp | Artesanato PP | Pres. Prudente | When I go to the search enterprises page And I fill in "query" with "Artesanato" @@ -83,7 +86,7 @@ Feature: search enterprises | name | state | | Pres. Prudente | SP | And the following enterprises - | identifier | name | city | + | identifier | name | region | | art-pp | Artesanato PP | Pres. Prudente | When I go to the search enterprises page And I fill in "query" with "Prudente" diff --git a/features/search_products.feature b/features/search_products.feature index e7aa631..e66a40e 100644 --- a/features/search_products.feature +++ b/features/search_products.feature @@ -116,7 +116,7 @@ Feature: search products | name | state | | Pres. Prudente | SP | And the following enterprise - | identifier | name | city | + | identifier | name | region | | art-pp | Artesanato PP | Pres. Prudente | And the following product_category | name | @@ -136,7 +136,7 @@ Feature: search products | name | state | | Pres. Prudente | SP | And the following enterprise - | identifier | name | city | + | identifier | name | region | | art-pp | Artesanato PP | Pres. Prudente | And the following product_category | name | diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index 326e2c2..d1b362e 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -33,6 +33,7 @@ Given /^the following (community|communities|enterprises?|organizations?)$/ do | domain = row.delete("domain") category = row.delete("category") img_name = row.delete("img") + city = row.delete("region") organization = klass.create!(row) if owner organization.add_admin(Profile[owner]) @@ -41,7 +42,6 @@ Given /^the following (community|communities|enterprises?|organizations?)$/ do | d = Domain.new :name => domain, :owner => organization d.save(false) end - city = row.delete("city") if city c = City.find_by_name city organization.region = c @@ -134,10 +134,10 @@ Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded f :language => language, :translation_of_id => translation_of_id) if !filename.blank? - item.merge!(:uploaded_data => fixture_file_upload("/files/#{filename}.png", 'image/png')) + item.merge!(:uploaded_data => fixture_file_upload("/files/#{filename}", 'binary/octet-stream')) end result = klass.new(item) - if parent + if !parent.blank? result.parent = Article.find_by_name(parent) end if category diff --git a/features/support/paths.rb b/features/support/paths.rb index fd92a44..f940dc1 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -17,6 +17,9 @@ module NavigationHelpers when /article "([^"]+)"\s*$/ url_for(Article.find_by_name($1).url.merge({:only_path => true})) + when /category "([^"]+)"/ + '/cat/%s' % Category.find_by_name($1).slug + when /edit "(.+)" by (.+)/ article_id = Person[$2].articles.find_by_slug($1.to_slug).id "/myprofile/#{$2}/cms/edit/#{article_id}" -- libgit2 0.21.2