From b2fbfd8ba0fc799cf23959dd760b728c02e1f7f2 Mon Sep 17 00:00:00 2001 From: Luciano Prestes Cavalcanti Date: Wed, 6 Jan 2016 18:38:43 +0100 Subject: [PATCH] Fix link of categories on categores_and_tags block --- src/noosfero-spb/software_communities/features/categories_and_tags_block.feature | 35 +++++++++++++++++++++++++++++++++++ src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb | 4 ++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/noosfero-spb/software_communities/features/categories_and_tags_block.feature diff --git a/src/noosfero-spb/software_communities/features/categories_and_tags_block.feature b/src/noosfero-spb/software_communities/features/categories_and_tags_block.feature new file mode 100644 index 0000000..116d8fc --- /dev/null +++ b/src/noosfero-spb/software_communities/features/categories_and_tags_block.feature @@ -0,0 +1,35 @@ +Feature: go to software search when click on category + As a user + I want to select a category + to see the softwares with the same 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 | + + Scenario: Search softwares by education category + Given I am logged in as mpog_admin + And I go to software-three's control panel + And I follow "Edit sideboxes" + And I follow "Add a block" + And I choose "Categories and Tags" + And I press "Add" + And I go to /software-three + When I follow "Education" + Then I should see "Software Two" + And I should see "Software Three" diff --git a/src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb b/src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb index 507ddbf..8563f07 100644 --- a/src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb +++ b/src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb @@ -3,7 +3,7 @@
<% block.owner.categories.each do |category| %> - <%= link_to category.name , category.path, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %> + <%= 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" %> <% end %>
<% end %> @@ -16,4 +16,4 @@ <%= link_to tag , "#", :id => "select-category-1-link", :class => "select-subcategory-link"%> <% end %> -<% end %> \ No newline at end of file +<% end %> -- libgit2 0.21.2