Commit b478a42439211aeba57ef697570578667ae44eee

Authored by Fabio Teixeira
1 parent 8f20ecab

find_offerer: Test corrections

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
test/functional/mpog_software_plugin_myprofile_controller_test.rb
@@ -15,8 +15,9 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase @@ -15,8 +15,9 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase
15 @offer_2 = create_user('Angelo Roberto') 15 @offer_2 = create_user('Angelo Roberto')
16 16
17 LicenseInfo.create(:version=>"CC-GPL-V2", :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt") 17 LicenseInfo.create(:version=>"CC-GPL-V2", :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt")
18 - ProgramLanguage.create(:name =>"language") 18 + ProgrammingLanguage.create(:name =>"language")
19 DatabaseDescription.create(:name => "database") 19 DatabaseDescription.create(:name => "database")
  20 + OperatingSystemName.create(:name=>"Debian")
20 21
21 login_as(@person.user.login) 22 login_as(@person.user.login)
22 e = Environment.default 23 e = Environment.default
@@ -36,7 +37,6 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase @@ -36,7 +37,6 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase
36 :intern => false , 37 :intern => false ,
37 :e_ping => false , 38 :e_ping => false ,
38 :e_arq => false, 39 :e_arq => false,
39 - :name =>'test',  
40 :operating_platform =>'operating_plataform_test', 40 :operating_platform =>'operating_plataform_test',
41 :demonstration_url => 'test', 41 :demonstration_url => 'test',
42 :acronym => 'test', 42 :acronym => 'test',
@@ -48,20 +48,25 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase @@ -48,20 +48,25 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase
48 :version => 'test', 48 :version => 'test',
49 :license=> 'test' 49 :license=> 'test'
50 },{}] 50 },{}]
  51 + operating_system = [{
  52 + :operating_system_name_id => OperatingSystemName.last.id,
  53 + :version => "stable"
  54 + }, {}]
51 database = [{ 55 database = [{
52 :database_description_id => DatabaseDescription.last.id, 56 :database_description_id => DatabaseDescription.last.id,
53 :version => 'database version', 57 :version => 'database version',
54 :operating_system => 'database operating_system' 58 :operating_system => 'database operating_system'
55 },{}] 59 },{}]
56 language = [{ 60 language = [{
57 - :program_languages_id => ProgramLanguage.last.id, 61 + :programming_language_id => ProgrammingLanguage.last.id,
58 :version => 'language version', 62 :version => 'language version',
59 :operating_system => 'language operating_system' 63 :operating_system => 'language operating_system'
60 },{}] 64 },{}]
61 65
62 license_info = {:version => "CC-GPL-V2",:link => "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt"} 66 license_info = {:version => "CC-GPL-V2",:link => "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt"}
63 post :new_software, :profile => person.identifier, :community => community, :license_info => license_info, 67 post :new_software, :profile => person.identifier, :community => community, :license_info => license_info,
64 - :software_info => software_info, :library => library, :database => database, :language => language, :q => @offer.id 68 + :software_info => software_info, :library => library, :database => database,
  69 + :language => language, :operating_system=>operating_system, :q => @offer.id
65 70
66 assert_equal @offer.id, Community.last.admins.last.id 71 assert_equal @offer.id, Community.last.admins.last.id
67 end 72 end