Commit 2bfe23633de7d16329006c1876fb5d90c7877301

Authored by Luciano Prestes
2 parents 68632e49 24fa1216

Merge branch 'fix_public_software_checkbox' into 'master'

Fix public software checkbox

MR consertando bug no checkbox para marcar se o software é público ou não. O Botão não estava salvando a ação de desmarcar. Ver issue #821

See merge request !236
src/noosfero-spb/software_communities/controllers/software_communities_plugin_myprofile_controller.rb
... ... @@ -33,9 +33,9 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController
33 33 software_info_insert_models.call(@list_languages, 'software_languages')
34 34 software_info_insert_models.call(@list_databases, 'software_databases')
35 35 software_info_insert_models.call(@list_operating_systems, 'operating_systems')
36   -
37 36 begin
38 37 raise NotAdminException unless can_change_public_software?
  38 + @software_info.public_software = params['software']['public_software'].present?
39 39 @software_info.update_attributes!(params[:software])
40 40  
41 41 @community = @software_info.community
... ...
src/noosfero-spb/software_communities/features/software_registration.feature
... ... @@ -11,9 +11,12 @@ Feature: edit public software information
11 11 And I check "SoftwareCommunitiesPlugin"
12 12 And I press "Save changes"
13 13 And I go to /myprofile/mpog-admin
  14 + Given the following users
  15 + | login | email |
  16 + | josesilva | silva@invalid.br |
14 17 And the following softwares
15   - | name | public_software | finality |
16   - | basic software | true | basic software finality |
  18 + | name | public_software | finality | owner |
  19 + | basic software | true | basic software finality | josesilva |
17 20  
18 21 @selenium
19 22 Scenario: Show SoftwareLangue fields when click in New Language
... ... @@ -85,3 +88,15 @@ Feature: edit public software information
85 88 And I follow "Software Info"
86 89 And I type in "gp" in autocomplete list "#license_info_version" and I choose "GPL-3"
87 90 Then I should see "Read license" within "#version_link"
  91 +
  92 + @selenium
  93 + Scenario: Env Admin be able to mark and unmark Software as Public Software
  94 + Given I go to /myprofile/basic-software/plugin/software_communities/edit_software
  95 + And I follow "Specifications"
  96 + Then the "software_public_software" checkbox should be checked
  97 + And I uncheck "software_public_software"
  98 + And I press "Save"
  99 + When I go to /myprofile/basic-software/plugin/software_communities/edit_software
  100 + And I follow "Specifications"
  101 + Then the "software_public_software" checkbox should not be checked
  102 +
... ...