diff --git a/test/unit/api/helpers_test.rb b/test/unit/api/helpers_test.rb index 50c4861..b27e87a 100644 --- a/test/unit/api/helpers_test.rb +++ b/test/unit/api/helpers_test.rb @@ -288,20 +288,6 @@ should 'verify if Serpro\' captcha token has been sent' do assert_equal(_("Missing Serpro's Captcha token"), r[0][:javascript_console_message]) end -should 'captcha serpro say name or service not known' do - environment = Environment.new - environment.api_captcha_settings = { - enabled: true, - provider: 'serpro', - serpro_client_id: '0000000000000000', - verify_uri: 'http://someserverthatdoesnotexist.mycompanythatdoesnotexist.com/validate', - } - params = {} - params[:txtToken_captcha_serpro_gov_br] = '4324343' - params[:captcha_text] = '4324343' - r = test_captcha('127.0.0.1', params, environment) - assert (r[0][:javascript_console_message]).starts_with?("Serpro captcha error: getaddrinfo") -end ###### END Captcha tests ###### diff --git a/test/unit/api/session_test.rb b/test/unit/api/session_test.rb index 7232640..a70a77e 100644 --- a/test/unit/api/session_test.rb +++ b/test/unit/api/session_test.rb @@ -89,22 +89,6 @@ class SessionTest < ActiveSupport::TestCase json = JSON.parse(last_response.body) end - should 'detected error, Name or service not known, for Serpro captcha communication' do - environment = Environment.default - environment.api_captcha_settings = { - enabled: true, - provider: 'serpro', - serpro_client_id: '0000000000000000', - verify_uri: 'http://someserverthatdoesnotexist.mycompanythatdoesnotexist.com/validate', - } - environment.save! - params = {:login => "newuserapi", :password => "newuserapi", :password_confirmation => "newuserapi", :email => "newuserapi@email.com", - :txtToken_captcha_serpro_gov_br => '4324343', :captcha_text => '4030320'} - post "/api/v1/register?#{params.to_query}" - message = JSON.parse(last_response.body)['javascript_console_message'] - assert_equal "Serpro captcha error: getaddrinfo: Name or service not known", message - end - # TODO: Add another test cases to check register situations should 'activate a user' do params = { @@ -185,7 +169,7 @@ class SessionTest < ActiveSupport::TestCase should 'do not change user password when password confirmation is wrong' do user = create_user - user.activate + user.activate task = ChangePassword.create!(:requestor => user.person) params = {:code => task.code, :password => 'secret', :password_confirmation => 's3cret'} patch "/api/v1/new_password?#{params.to_query}" -- libgit2 0.21.2