Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed some more search features

  • Loading branch information...
commit 64009edd9e7e0109fba1889bccebd9624d9dbc17 1 parent a418a38
@rafaelmessias rafaelmessias authored
View
2  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
View
36 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
View
23 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 <i>homepage</i> 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 <b>clothes</b> 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 <i>homepage</i> 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 <b>clothes</b> 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"
View
4 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 |
View
6 features/step_definitions/noosfero_steps.rb
@@ -33,6 +33,7 @@ def selenium_driver?
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 @@ def selenium_driver?
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 @@ def selenium_driver?
: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
View
3  features/support/paths.rb
@@ -17,6 +17,9 @@ def path_to(page_name)
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}"
Please sign in to comment.
Something went wrong with that request. Please try again.