Commit 5e3adf3365d22cb70dd53e71d78041ef385179a3

Authored by Fabio Teixeira
Committed by Luciano Prestes
1 parent 7b9b2e23

Fix functionals tests

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
lib/ext/profile_editor_controller.rb
@@ -13,7 +13,6 @@ class ProfileEditorController @@ -13,7 +13,6 @@ class ProfileEditorController
13 13
14 protected 14 protected
15 15
16 -  
17 def redirect_to_edit_software_community 16 def redirect_to_edit_software_community
18 if profile.class == Community && profile.software? 17 if profile.class == Community && profile.software?
19 redirect_to :action => 'edit_software_community' 18 redirect_to :action => 'edit_software_community'
test/functional/software_communities_plugin_myprofile_controller_test.rb
@@ -78,7 +78,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC @@ -78,7 +78,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC
78 :new_software, 78 :new_software,
79 :profile => @person.identifier, 79 :profile => @person.identifier,
80 :community => fields[1], 80 :community => fields[1],
81 - :license_info => fields[0], 81 + :license => fields[0],
82 :software_info => fields[2] 82 :software_info => fields[2]
83 ) 83 )
84 assert_equal SoftwareInfo.last.community.name, "Debian" 84 assert_equal SoftwareInfo.last.community.name, "Debian"
@@ -227,7 +227,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC @@ -227,7 +227,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC
227 :new_software, 227 :new_software,
228 :community => {:name =>"New Software"}, 228 :community => {:name =>"New Software"},
229 :software_info => {:finality => "", :repository_link => ""}, 229 :software_info => {:finality => "", :repository_link => ""},
230 - :license_info =>{:id => LicenseInfo.last.id}, 230 + :license =>{:license_infos_id => LicenseInfo.last.id},
231 :profile => @person.identifier 231 :profile => @person.identifier
232 ) 232 )
233 233
@@ -245,9 +245,10 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC @@ -245,9 +245,10 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC
245 :new_software, 245 :new_software,
246 :community => { :name =>"New Software" }, 246 :community => { :name =>"New Software" },
247 :software_info => { :finality => "", :repository_link => "" }, 247 :software_info => { :finality => "", :repository_link => "" },
248 - :license_info =>{ :id => license_another.id },  
249 - :license => { :version => another_license_version,  
250 - :link => another_license_link }, 248 + :license => { :license_infos_id => license_another.id,
  249 + :version => another_license_version,
  250 + :link=> another_license_link
  251 + },
251 :profile => @person.identifier 252 :profile => @person.identifier
252 ) 253 )
253 254
test/helpers/software_test_helper.rb
@@ -80,9 +80,10 @@ module SoftwareTestHelper @@ -80,9 +80,10 @@ module SoftwareTestHelper
80 80
81 community.save! 81 community.save!
82 software.community = community 82 software.community = community
83 - software.license_info_id = license_system_hash 83 + software.license_info_id = license_system_hash[:license_infos_id]
  84 +
  85 + software.save!
84 86
85 - software.save  
86 software 87 software
87 end 88 end
88 89
@@ -164,25 +165,29 @@ module SoftwareTestHelper @@ -164,25 +165,29 @@ module SoftwareTestHelper
164 end 165 end
165 166
166 def software_fields 167 def software_fields
167 - fields = Hash.new  
168 - fields_community = Hash.new  
169 - fields_license = Hash.new  
170 hash_list = [] 168 hash_list = []
171 169
172 #Fields for license info 170 #Fields for license info
173 - fields_license['version'] = LicenseInfo.last.version  
174 - fields_license['id'] = LicenseInfo.last.id 171 + fields_license = {
  172 + license_infos_id: LicenseInfo.last.id
  173 + }
175 hash_list << fields_license 174 hash_list << fields_license
176 175
177 #Fields for community 176 #Fields for community
178 - fields_community['name'] = 'Debian'  
179 - fields_community['identifier'] = 'debian' 177 + fields_community = {
  178 + name: 'Debian',
  179 + identifier: 'debian'
  180 + }
180 hash_list << fields_community 181 hash_list << fields_community
181 182
182 #Fields for basic information 183 #Fields for basic information
183 - fields['finality'] = 'This is the finality of the software' 184 + fields = {
  185 + finality: 'This is the finality of the software'
  186 + }
184 hash_list << fields 187 hash_list << fields
185 188
186 hash_list 189 hash_list
187 end 190 end
188 end 191 end
  192 +#version: LicenseInfo.last.version,
  193 +#id: LicenseInfo.last.id
189 \ No newline at end of file 194 \ No newline at end of file