Commit 80ab88b8494f40d75fb2c95f2c1bf5f94c4e3953

Authored by Rodrigo Souto
2 parents 33b7a14c f2ff532f

Merge branch 'fix_categories_software_link' into 'master'

Update categories software block

Link of CategoriesSoftware open the search softwares page with "all" selected

See merge request !184
src/noosfero-spb/software_communities/features/categories_softwares_block.feature 0 → 100644
@@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
  1 +Feature: go to software search when click on category
  2 + As a user
  3 + I want to select a category
  4 + to see the softwares with the selected category
  5 +
  6 + Background:
  7 + Given "SoftwareCommunitiesPlugin" plugin is enabled
  8 + And I am logged in as mpog_admin
  9 + And I go to /admin/plugins
  10 + And I check "SoftwareCommunitiesPlugin"
  11 + And I press "Save changes"
  12 + And the following categories
  13 + | name | display_in_menu |
  14 + | Software | true |
  15 + And the following categories
  16 + | parent | name | display_in_menu |
  17 + | Software | Health | true |
  18 + | Software | Education | true |
  19 + And the following softwares
  20 + | name | public_software | categories | finality |
  21 + | Software One | true | Health | some finality |
  22 + | Software Two | true | Health, Education | some finality |
  23 + | Software Three | false | Education | some finality |
  24 + And the following blocks
  25 + | owner | type |
  26 + | environment | CategoriesSoftwareBlock |
  27 +
  28 + Scenario: Search softwares by education category
  29 + Given I go to /
  30 + When I follow "Education"
  31 + Then I should see "Software Two"
  32 + And I should see "Software Three"
  33 + And I should not see "Software One"
  34 +
src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 10
11 <% categories.each do |category| %> 11 <% categories.each do |category| %>
12 <% unless category.software_infos.count < 1 %> 12 <% unless category.software_infos.count < 1 %>
13 - <li><%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id]} %></li> 13 + <li><%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id], :software_type => "all" } %></li>
14 <% end %> 14 <% end %>
15 <% end %> 15 <% end %>
16 </ul> 16 </ul>