Commit 096b293299a41d7ca5a60406d5cab83fa553f463

Authored by Rafael Martins
1 parent 476f551f

Fixed some search features

features/search_contents.feature
@@ -86,7 +86,7 @@ Feature: search contents @@ -86,7 +86,7 @@ Feature: search contents
86 Given the following uploaded files 86 Given the following uploaded files
87 | owner | name | filename | 87 | owner | name | filename |
88 | joaosilva | Uploaded Executable | rails | 88 | joaosilva | Uploaded Executable | rails |
89 - | joaosilva | Uploaded Spreadsheet | rails | 89 + | joaosilva | Uploaded Spreadsheet | shoes |
90 When I search contents for "Executable" 90 When I search contents for "Executable"
91 Then I should see "Uploaded Executable" within ".search-uploaded-file-item" 91 Then I should see "Uploaded Executable" within ".search-uploaded-file-item"
92 And I should not see "Uploaded Spreadsheet" 92 And I should not see "Uploaded Spreadsheet"
@@ -315,7 +315,7 @@ Feature: search contents @@ -315,7 +315,7 @@ Feature: search contents
315 When I go to the search articles page 315 When I go to the search articles page
316 And I fill in "query" with "this is an article" 316 And I fill in "query" with "this is an article"
317 And I press "Search" 317 And I press "Search"
318 - Then show me the page 318 + # Then show me the page
319 And I follow "Software Livre" within "#facets-menu" 319 And I follow "Software Livre" within "#facets-menu"
320 Then I should see "noosfero and debian" within "#search-results" 320 Then I should see "noosfero and debian" within "#search-results"
321 And I should not see "facebook and 1984" 321 And I should not see "facebook and 1984"
features/search_enterprises.feature
@@ -36,7 +36,7 @@ Feature: search enterprises @@ -36,7 +36,7 @@ Feature: search enterprises
36 Scenario: link to enterprise homepage on search results 36 Scenario: link to enterprise homepage on search results
37 Given I search enterprises for "shoes" 37 Given I search enterprises for "shoes"
38 When I follow "Shoes shop" 38 When I follow "Shoes shop"
39 - Then I should be on "Shoes shop" homepage 39 + Then I should be on Shoes shop's profile
40 40
41 Scenario: show clean enterprise description on search results 41 Scenario: show clean enterprise description on search results
42 Given the following articles 42 Given the following articles
@@ -110,7 +110,7 @@ Feature: search enterprises @@ -110,7 +110,7 @@ Feature: search enterprises
110 | Rails | software-livre | 110 | Rails | software-livre |
111 And the following enterprises 111 And the following enterprises
112 | identifier | name | category | 112 | identifier | name | category |
113 - | noosfero | Noosfero | Rails | 113 + | noosfero | Noosfero | rails |
114 When I search enterprises for "Rails" 114 When I search enterprises for "Rails"
115 Then I should see "Software Livre" within ".search-enterprise-category" 115 Then I should see "Software Livre" within ".search-enterprise-category"
116 And I should see "Rails" within ".search-enterprise-category" 116 And I should see "Rails" within ".search-enterprise-category"
features/step_definitions/noosfero_steps.rb
@@ -247,7 +247,7 @@ Given /^the following (product_categories|product_category|category|categories|r @@ -247,7 +247,7 @@ Given /^the following (product_categories|product_category|category|categories|r
247 klass = kind.singularize.camelize.constantize 247 klass = kind.singularize.camelize.constantize
248 table.hashes.each do |row| 248 table.hashes.each do |row|
249 parent = row.delete("parent") 249 parent = row.delete("parent")
250 - if parent 250 + if !parent.blank?
251 parent = Category.find_by_slug(parent.to_slug) 251 parent = Category.find_by_slug(parent.to_slug)
252 row.merge!({:parent_id => parent.id}) 252 row.merge!({:parent_id => parent.id})
253 end 253 end