Commit db699a3f2747358e5d490023a721488bb84c12a6
1 parent
11a79299
Exists in
master
and in
79 other branches
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>
Showing
2 changed files
with
2 additions
and
98 deletions
Show diff stats
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"> | ... | ... |