Commit 4c7d2f35a2412641863ad01679be991e105b6c3b
Exists in
theme-brasil-digital-from-staging
and in
5 other branches
Merge branch 'staging' of softwarepublico.gov.br:noosferogov/noosfero into staging
Showing
3 changed files
with
2 additions
and
32 deletions
Show diff stats
plugins/dialoga
test/unit/api/helpers_test.rb
| ... | ... | @@ -288,20 +288,6 @@ should 'verify if Serpro\' captcha token has been sent' do |
| 288 | 288 | assert_equal(_("Missing Serpro's Captcha token"), r[0][:javascript_console_message]) |
| 289 | 289 | end |
| 290 | 290 | |
| 291 | -should 'captcha serpro say name or service not known' do | |
| 292 | - environment = Environment.new | |
| 293 | - environment.api_captcha_settings = { | |
| 294 | - enabled: true, | |
| 295 | - provider: 'serpro', | |
| 296 | - serpro_client_id: '0000000000000000', | |
| 297 | - verify_uri: 'http://someserverthatdoesnotexist.mycompanythatdoesnotexist.com/validate', | |
| 298 | - } | |
| 299 | - params = {} | |
| 300 | - params[:txtToken_captcha_serpro_gov_br] = '4324343' | |
| 301 | - params[:captcha_text] = '4324343' | |
| 302 | - r = test_captcha('127.0.0.1', params, environment) | |
| 303 | - assert (r[0][:javascript_console_message]).starts_with?("Serpro captcha error: getaddrinfo") | |
| 304 | -end | |
| 305 | 291 | |
| 306 | 292 | ###### END Captcha tests ###### |
| 307 | 293 | ... | ... |
test/unit/api/session_test.rb
| ... | ... | @@ -89,22 +89,6 @@ class SessionTest < ActiveSupport::TestCase |
| 89 | 89 | json = JSON.parse(last_response.body) |
| 90 | 90 | end |
| 91 | 91 | |
| 92 | - should 'detected error, Name or service not known, for Serpro captcha communication' do | |
| 93 | - environment = Environment.default | |
| 94 | - environment.api_captcha_settings = { | |
| 95 | - enabled: true, | |
| 96 | - provider: 'serpro', | |
| 97 | - serpro_client_id: '0000000000000000', | |
| 98 | - verify_uri: 'http://someserverthatdoesnotexist.mycompanythatdoesnotexist.com/validate', | |
| 99 | - } | |
| 100 | - environment.save! | |
| 101 | - params = {:login => "newuserapi", :password => "newuserapi", :password_confirmation => "newuserapi", :email => "newuserapi@email.com", | |
| 102 | - :txtToken_captcha_serpro_gov_br => '4324343', :captcha_text => '4030320'} | |
| 103 | - post "/api/v1/register?#{params.to_query}" | |
| 104 | - message = JSON.parse(last_response.body)['javascript_console_message'] | |
| 105 | - assert_equal "Serpro captcha error: getaddrinfo: Name or service not known", message | |
| 106 | - end | |
| 107 | - | |
| 108 | 92 | # TODO: Add another test cases to check register situations |
| 109 | 93 | should 'activate a user' do |
| 110 | 94 | params = { |
| ... | ... | @@ -185,7 +169,7 @@ class SessionTest < ActiveSupport::TestCase |
| 185 | 169 | |
| 186 | 170 | should 'do not change user password when password confirmation is wrong' do |
| 187 | 171 | user = create_user |
| 188 | - user.activate | |
| 172 | + user.activate | |
| 189 | 173 | task = ChangePassword.create!(:requestor => user.person) |
| 190 | 174 | params = {:code => task.code, :password => 'secret', :password_confirmation => 's3cret'} |
| 191 | 175 | patch "/api/v1/new_password?#{params.to_query}" | ... | ... |