diff --git a/lib/ext/profile_editor_controller.rb b/lib/ext/profile_editor_controller.rb index e14fd25..75282e0 100644 --- a/lib/ext/profile_editor_controller.rb +++ b/lib/ext/profile_editor_controller.rb @@ -13,7 +13,6 @@ class ProfileEditorController protected - def redirect_to_edit_software_community if profile.class == Community && profile.software? redirect_to :action => 'edit_software_community' diff --git a/test/functional/software_communities_plugin_myprofile_controller_test.rb b/test/functional/software_communities_plugin_myprofile_controller_test.rb index 155997e..a8586ba 100644 --- a/test/functional/software_communities_plugin_myprofile_controller_test.rb +++ b/test/functional/software_communities_plugin_myprofile_controller_test.rb @@ -78,7 +78,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC :new_software, :profile => @person.identifier, :community => fields[1], - :license_info => fields[0], + :license => fields[0], :software_info => fields[2] ) assert_equal SoftwareInfo.last.community.name, "Debian" @@ -227,7 +227,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC :new_software, :community => {:name =>"New Software"}, :software_info => {:finality => "", :repository_link => ""}, - :license_info =>{:id => LicenseInfo.last.id}, + :license =>{:license_infos_id => LicenseInfo.last.id}, :profile => @person.identifier ) @@ -245,9 +245,10 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC :new_software, :community => { :name =>"New Software" }, :software_info => { :finality => "", :repository_link => "" }, - :license_info =>{ :id => license_another.id }, - :license => { :version => another_license_version, - :link => another_license_link }, + :license => { :license_infos_id => license_another.id, + :version => another_license_version, + :link=> another_license_link + }, :profile => @person.identifier ) diff --git a/test/helpers/software_test_helper.rb b/test/helpers/software_test_helper.rb index c35aa05..285fd27 100644 --- a/test/helpers/software_test_helper.rb +++ b/test/helpers/software_test_helper.rb @@ -80,9 +80,10 @@ module SoftwareTestHelper community.save! software.community = community - software.license_info_id = license_system_hash + software.license_info_id = license_system_hash[:license_infos_id] + + software.save! - software.save software end @@ -164,25 +165,29 @@ module SoftwareTestHelper end def software_fields - fields = Hash.new - fields_community = Hash.new - fields_license = Hash.new hash_list = [] #Fields for license info - fields_license['version'] = LicenseInfo.last.version - fields_license['id'] = LicenseInfo.last.id + fields_license = { + license_infos_id: LicenseInfo.last.id + } hash_list << fields_license #Fields for community - fields_community['name'] = 'Debian' - fields_community['identifier'] = 'debian' + fields_community = { + name: 'Debian', + identifier: 'debian' + } hash_list << fields_community #Fields for basic information - fields['finality'] = 'This is the finality of the software' + fields = { + finality: 'This is the finality of the software' + } hash_list << fields hash_list end end +#version: LicenseInfo.last.version, +#id: LicenseInfo.last.id \ No newline at end of file -- libgit2 0.21.2