Commit b2fbfd8ba0fc799cf23959dd760b728c02e1f7f2

Authored by Luciano Prestes
1 parent eb4ff668

Fix link of categories on categores_and_tags block

Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
src/noosfero-spb/software_communities/features/categories_and_tags_block.feature 0 → 100644
... ... @@ -0,0 +1,35 @@
  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 same 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 +
  25 + Scenario: Search softwares by education category
  26 + Given I am logged in as mpog_admin
  27 + And I go to software-three's control panel
  28 + And I follow "Edit sideboxes"
  29 + And I follow "Add a block"
  30 + And I choose "Categories and Tags"
  31 + And I press "Add"
  32 + And I go to /software-three
  33 + When I follow "Education"
  34 + Then I should see "Software Two"
  35 + And I should see "Software Three"
... ...
src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb
... ... @@ -3,7 +3,7 @@
3 3  
4 4 <div class="category_cloud">
5 5 <% block.owner.categories.each do |category| %>
6   - <%= link_to category.name , category.path, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %>
  6 + <%= link_to category.name, {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id], :software_type => 'all'}, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %>
7 7 <% end %>
8 8 </div><!-- end class='category_cloud' -->
9 9 <% end %>
... ... @@ -16,4 +16,4 @@
16 16 <%= link_to tag , "#", :id => "select-category-1-link", :class => "select-subcategory-link"%>
17 17 <% end %>
18 18 </div>
19   -<% end %>
20 19 \ No newline at end of file
  20 +<% end %>
... ...