Commit db699a3f2747358e5d490023a721488bb84c12a6

Authored by Álvaro Fernando Matos de Souza
1 parent 11a79299
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Removing unnecessary test of institution helper

Signed-off-by: Álvaro Fernando <alvarofernandoms@gmail.com>
Signed-off-by: ArthurJahn <stutrzbecher@gmail.com>
Signed-off-by: Thiago Ribeiro <thiagitosouza@gmail.com>
test/functional/profile_controller_test.rb
... ... @@ -1,96 +0,0 @@
1   -require File.expand_path(File.dirname(__FILE__)) + '/../../../../test/test_helper'
2   -require File.expand_path(File.dirname(__FILE__)) + '/../helpers/software_test_helper'
3   -require(
4   - File.expand_path(File.dirname(__FILE__)) +
5   - '/../../../../app/controllers/public/profile_controller'
6   -)
7   -
8   -class ProfileController; def rescue_action(e) raise e end; end
9   -
10   -class ProfileControllerTest < ActionController::TestCase
11   - include SoftwareTestHelper
12   -
13   - def setup
14   - @controller =CommunitiesRatingsPluginProfileController.new
15   - @request = ActionController::TestRequest.new
16   - @response = ActionController::TestResponse.new
17   - @profile = create_user('default_user').person
18   -
19   - LicenseInfo.create(
20   - :version=>"CC-GPL-V2",
21   - :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt"
22   - )
23   -
24   - @environment = Environment.default
25   - @environment.enabled_plugins = ['SoftwareCommunitiesPlugin', 'CommunitiesRatingsPlugin']
26   - @admin = create_user("adminuser").person
27   - @admin.stubs(:has_permission?).returns("true")
28   - @environment.add_admin(@admin)
29   - @environment.save
30   -
31   - @software = create_software(software_fields)
32   - end
33   -
34   - should "dispach additional comment fields when a software is rated" do
35   - login_as(@admin.name)
36   - get :new_rating , profile: @software.community.identifier
37   - assert_template :new_rating
38   - assert_match(/Additional informations/, @response.body)
39   - end
40   -
41   - should "DO NOT dispach additional comment fields when the rated community isn't a software" do
42   - login_as(@admin.name)
43   - community = fast_create(Community)
44   -
45   - get :new_rating , profile: community.identifier
46   - assert_template :new_rating
47   - assert_not_match(/Additional informations/, @response.body)
48   - end
49   -
50   - should "show additional comment fields on rate list if logged user is a environment admin" do
51   - login_as(@admin.name)
52   - seed_avaliations
53   -
54   - get :new_rating , profile: @software.community.identifier
55   -
56   - assert_match("<span>People benefited :</span> 123", @response.body)
57   - assert_match("<span>Saved Value :</span> 123456.0", @response.body)
58   - end
59   -
60   - should "show additional comment fields on rate list if logged user is the software admin" do
61   - seed_avaliations
62   - login_as(@profile.name)
63   - @software.community.add_admin @profile
64   -
65   - get :new_rating , profile: @software.community.identifier
66   -
67   - assert_match("<span>People benefited :</span> 123", @response.body)
68   - assert_match("<span>Saved Value :</span> 123456.0", @response.body)
69   - end
70   -
71   - should "DO NOT show additional comment fields on rate list if logged user in't a admin" do
72   - login_as(@profile.name)
73   - seed_avaliations
74   -
75   - get :new_rating , profile: @software.community.identifier
76   -
77   - assert_not_match("<span>People benefited :</span> 123", @response.body)
78   - assert_not_match("<span>Saved Value :</span> 123456.0", @response.body)
79   - end
80   -
81   - private
82   -
83   - def make_avaliation software, person, rate_value, people_benefited, saved_value
84   - comment = Comment.create! :author=>person, :body=>"simple body", :people_benefited=>people_benefited, :saved_value=>saved_value
85   - rate = CommunityRating.new :value=>rate_value, :person=>person, :community=>software.community
86   -
87   - rate.comment = comment
88   - rate.save!
89   - rate
90   - end
91   -
92   - def seed_avaliations
93   - make_avaliation @software, @profile, 1, 123, 123456
94   - make_avaliation @software, @admin, 2, 456, 789456
95   - end
96   -end
97 0 \ No newline at end of file
views/search/_software_search_form.html.erb
... ... @@ -12,10 +12,10 @@
12 12 <%= hidden_field_tag :filter, params[:filter] %>
13 13  
14 14 <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %>
15   - <span class"doubts-catalog-software" title="<%= _('Public Software.') %>">(?)</span>
  15 + <span class"doubts-catalog-software" title="<%= _('Public Software.') %>">?</span>
16 16  
17 17 <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %>
18   - <span class"doubts-catalog-software" title="<%= _('All.') %>">(?)</span>
  18 + <span class"doubts-catalog-software" title="<%= _('All.') %>">?</span>
19 19  
20 20 <div class="search-field">
21 21 <span class="formfield">
... ...