From c5363ef090a2afffdbbcacbb093a974ca0ce6693 Mon Sep 17 00:00:00 2001 From: Rafael Martins Date: Tue, 21 Feb 2012 22:06:57 -0200 Subject: [PATCH] Cucumber feature for searching communities --- features/search_communities.feature | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+), 0 deletions(-) create mode 100644 features/search_communities.feature diff --git a/features/search_communities.feature b/features/search_communities.feature new file mode 100644 index 0000000..71e3a1c --- /dev/null +++ b/features/search_communities.feature @@ -0,0 +1,104 @@ +Feature: search communities + As a noosfero user + I want to search communities + In order to find ones that interest me + + Background: + Given the search index is empty + And the following category + | name | + | social network | + And the following community + | identifier | name | category | + | noosfero | Noosfero Community | social-network | + + Scenario: show recent communities on index (empty query) + Given the following community + | identifier | name | category | + | linux | Linux Community | software-livre | + When I go to the search communities page + Then I should see "Noosfero Community" within "#search-results" + And I should see "Linux Community" within "#search-results" + + Scenario: simple search for community + When I go to the search communities page + And I fill in "query" with "noosfero" + And I press "Search" + Then I should see "Noosfero Community" within "#search-results" + + Scenario: search communities by category + Given the following category + | name | + | Software Livre | + And the following community + | identifier | name | category | + | noos-comm | Noosfero Community | software-livre | + When I go to the search communities page + And I fill in "query" with "software livre" + And I press "Search" + Then I should see "Noosfero" within "#search-results" + + Scenario: see category facets when searching + Given the following categories as facets + | name | + | Temáticas | + And the following category + | name | parent | + | Software Livre | tematicas | + And the following community + | identifier | name | category | + | linux | Linux Community | software-livre | + When I go to the search communities page + And I fill in "query" with "Linux" + And I press "Search" + Then I should see "Temáticas" within "#facets-menu" + + Scenario: find communities without exact query + Given the following communities + | identifier | name | + | luwac | Linux Users Without a Clue | + When I go to the search communities page + And I fill in "query" with "Linux Clue" + And I press "Search" + Then I should see "Linux Users Without a Clue" within "#search-results" + + Scenario: filter communities by facet + Given the following categories as facets + | name | + | Temáticas | + And the following category + | name | parent | + | Software Livre | tematicas | + | Big Brother | tematicas | + And the following communities + | identifier | name | category | + | noos-dev | Noosfero Developers | software-livre | + | facebook | Facebook Developers | big-brother | + When I go to the search communities page + And I fill in "query" with "Developers" + And I press "Search" + And I follow "Software Livre" within "#facets-menu" + Then I should see "Noosfero Developers" within "#search-results" + And I should not see "Facebook Developers" + + Scenario: remember facet filter when searching new query + Given the following categories as facets + | name | + | Temáticas | + And the following category + | name | parent | + | Software Livre | tematicas | + | Other Category | tematicas | + And the following communities + | identifier | name | category | + | noos-dev | Noosfero Developers | software-livre | + | rails-dev | Rails Developers | other-category | + | rails-usr | Rails Users | software-livre | + When I go to the search communities page + And I fill in "query" with "Developers" + And I press "Search" + And I follow "Software Livre" within "#facets-menu" + And I fill in "query" with "Rails" + And I press "Search" + Then I should see "Rails Users" within "#search-results" + And I should not see "Rails Developers" -- libgit2 0.21.2