Commit 5e3adf3365d22cb70dd53e71d78041ef385179a3
Committed by
Luciano Prestes
1 parent
7b9b2e23
Exists in
master
and in
5 other branches
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>
Showing
3 changed files
with
21 additions
and
16 deletions
Show diff stats
lib/ext/profile_editor_controller.rb
test/functional/software_communities_plugin_myprofile_controller_test.rb
| ... | ... | @@ -78,7 +78,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
| 78 | 78 | :new_software, |
| 79 | 79 | :profile => @person.identifier, |
| 80 | 80 | :community => fields[1], |
| 81 | - :license_info => fields[0], | |
| 81 | + :license => fields[0], | |
| 82 | 82 | :software_info => fields[2] |
| 83 | 83 | ) |
| 84 | 84 | assert_equal SoftwareInfo.last.community.name, "Debian" |
| ... | ... | @@ -227,7 +227,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
| 227 | 227 | :new_software, |
| 228 | 228 | :community => {:name =>"New Software"}, |
| 229 | 229 | :software_info => {:finality => "", :repository_link => ""}, |
| 230 | - :license_info =>{:id => LicenseInfo.last.id}, | |
| 230 | + :license =>{:license_infos_id => LicenseInfo.last.id}, | |
| 231 | 231 | :profile => @person.identifier |
| 232 | 232 | ) |
| 233 | 233 | |
| ... | ... | @@ -245,9 +245,10 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
| 245 | 245 | :new_software, |
| 246 | 246 | :community => { :name =>"New Software" }, |
| 247 | 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 | 252 | :profile => @person.identifier |
| 252 | 253 | ) |
| 253 | 254 | ... | ... |
test/helpers/software_test_helper.rb
| ... | ... | @@ -80,9 +80,10 @@ module SoftwareTestHelper |
| 80 | 80 | |
| 81 | 81 | community.save! |
| 82 | 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 | 87 | software |
| 87 | 88 | end |
| 88 | 89 | |
| ... | ... | @@ -164,25 +165,29 @@ module SoftwareTestHelper |
| 164 | 165 | end |
| 165 | 166 | |
| 166 | 167 | def software_fields |
| 167 | - fields = Hash.new | |
| 168 | - fields_community = Hash.new | |
| 169 | - fields_license = Hash.new | |
| 170 | 168 | hash_list = [] |
| 171 | 169 | |
| 172 | 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 | 174 | hash_list << fields_license |
| 176 | 175 | |
| 177 | 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 | 181 | hash_list << fields_community |
| 181 | 182 | |
| 182 | 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 | 187 | hash_list << fields |
| 185 | 188 | |
| 186 | 189 | hash_list |
| 187 | 190 | end |
| 188 | 191 | end |
| 192 | +#version: LicenseInfo.last.version, | |
| 193 | +#id: LicenseInfo.last.id | |
| 189 | 194 | \ No newline at end of file | ... | ... |