From f2ff532f75c1dbe9fdc02e01e48e1584084f2bdc Mon Sep 17 00:00:00 2001 From: Luciano Prestes Cavalcanti Date: Tue, 16 Feb 2016 12:53:47 +0000 Subject: [PATCH] Update categories software block --- src/noosfero-spb/software_communities/features/categories_softwares_block.feature | 34 ++++++++++++++++++++++++++++++++++ src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/noosfero-spb/software_communities/features/categories_softwares_block.feature diff --git a/src/noosfero-spb/software_communities/features/categories_softwares_block.feature b/src/noosfero-spb/software_communities/features/categories_softwares_block.feature new file mode 100644 index 0000000..06c4643 --- /dev/null +++ b/src/noosfero-spb/software_communities/features/categories_softwares_block.feature @@ -0,0 +1,34 @@ +Feature: go to software search when click on category + As a user + I want to select a category + to see the softwares with the selected category + + Background: + Given "SoftwareCommunitiesPlugin" plugin is enabled + And I am logged in as mpog_admin + And I go to /admin/plugins + And I check "SoftwareCommunitiesPlugin" + And I press "Save changes" + And the following categories + | name | display_in_menu | + | Software | true | + And the following categories + | parent | name | display_in_menu | + | Software | Health | true | + | Software | Education | true | + And the following softwares + | name | public_software | categories | finality | + | Software One | true | Health | some finality | + | Software Two | true | Health, Education | some finality | + | Software Three | false | Education | some finality | + And the following blocks + | owner | type | + | environment | CategoriesSoftwareBlock | + + Scenario: Search softwares by education category + Given I go to / + When I follow "Education" + Then I should see "Software Two" + And I should see "Software Three" + And I should not see "Software One" + diff --git a/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb b/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb index 144350b..8ed545d 100644 --- a/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb +++ b/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb @@ -10,7 +10,7 @@ <% categories.each do |category| %> <% unless category.software_infos.count < 1 %> -
  • <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id]} %>
  • +
  • <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id], :software_type => "all" } %>
  • <% end %> <% end %> -- libgit2 0.21.2