Commit e50b5e5aa4d1773fd0e5b78be9940e2a0b6cf25c

Authored by Luciano Prestes
1 parent 06e544ca

Fix functional tests

Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
test/functional/account_controller_test.rb
@@ -40,11 +40,11 @@ class AccountControllerTest &lt; ActionController::TestCase @@ -40,11 +40,11 @@ class AccountControllerTest &lt; ActionController::TestCase
40 } 40 }
41 41
42 @profile_data_info = { 42 @profile_data_info = {
43 - :name=>"Um novo usuario", 43 + :name=>"Um Novo Usuario",
44 } 44 }
45 45
46 @second_profile_data_info = { 46 @second_profile_data_info = {
47 - :name=>"Um outro usuario", 47 + :name=>"Um Outro Usuario",
48 } 48 }
49 disable_signup_bot_check 49 disable_signup_bot_check
50 end 50 end
test/functional/mpog_software_plugin_myprofile_controller_test.rb
@@ -41,17 +41,19 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase @@ -41,17 +41,19 @@ class MpogSoftwarePluginMyprofileControllerTest &lt; ActionController::TestCase
41 offer_token = "An" 41 offer_token = "An"
42 post :search_offerers, :profile => person.identifier,:q => offer_token 42 post :search_offerers, :profile => person.identifier,:q => offer_token
43 response = JSON.parse(@response.body) 43 response = JSON.parse(@response.body)
44 - assert_equal "Angelo Roberto",response[0]["name"]  
45 - assert_equal "Ana de Souza",response[1]["name"]  
46 - assert_equal "Angela Silva",response[2]["name"] 44 + response.sort!{|a, b| a["name"] <=> b["name"]}
  45 + assert_equal "Ana de Souza",response[0]["name"]
  46 + assert_equal "Angela Silva",response[1]["name"]
  47 + assert_equal "Angelo Roberto",response[2]["name"]
47 end 48 end
48 49
49 should 'make search for Ang for offerer in software creation' do 50 should 'make search for Ang for offerer in software creation' do
50 offer_token = "Ang" 51 offer_token = "Ang"
51 post :search_offerers, :profile => person.identifier,:q => offer_token 52 post :search_offerers, :profile => person.identifier,:q => offer_token
52 response = JSON.parse(@response.body) 53 response = JSON.parse(@response.body)
53 - assert_equal "Angelo Roberto",response[0]["name"]  
54 - assert_equal "Angela Silva",response[1]["name"] 54 + response.sort!{|a, b| a["name"] <=> b["name"]}
  55 + assert_equal "Angela Silva",response[0]["name"]
  56 + assert_equal "Angelo Roberto",response[1]["name"]
55 end 57 end
56 58
57 should 'not find any offerer for software creation' do 59 should 'not find any offerer for software creation' do