Commit d9dfa9d5f618b4466dedd9b70a8e48bd693e9810
1 parent
c98ad822
Exists in
theme-brasil-digital-from-staging
and in
6 other branches
remove tests used for old captcha system
Showing
2 changed files
with
1 additions
and
31 deletions
Show diff stats
test/unit/api/helpers_test.rb
@@ -288,20 +288,6 @@ should 'verify if Serpro\' captcha token has been sent' do | @@ -288,20 +288,6 @@ should 'verify if Serpro\' captcha token has been sent' do | ||
288 | assert_equal(_("Missing Serpro's Captcha token"), r[0][:javascript_console_message]) | 288 | assert_equal(_("Missing Serpro's Captcha token"), r[0][:javascript_console_message]) |
289 | end | 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 | ###### END Captcha tests ###### | 292 | ###### END Captcha tests ###### |
307 | 293 |
test/unit/api/session_test.rb
@@ -89,22 +89,6 @@ class SessionTest < ActiveSupport::TestCase | @@ -89,22 +89,6 @@ class SessionTest < ActiveSupport::TestCase | ||
89 | json = JSON.parse(last_response.body) | 89 | json = JSON.parse(last_response.body) |
90 | end | 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 | # TODO: Add another test cases to check register situations | 92 | # TODO: Add another test cases to check register situations |
109 | should 'activate a user' do | 93 | should 'activate a user' do |
110 | params = { | 94 | params = { |
@@ -185,7 +169,7 @@ class SessionTest < ActiveSupport::TestCase | @@ -185,7 +169,7 @@ class SessionTest < ActiveSupport::TestCase | ||
185 | 169 | ||
186 | should 'do not change user password when password confirmation is wrong' do | 170 | should 'do not change user password when password confirmation is wrong' do |
187 | user = create_user | 171 | user = create_user |
188 | - user.activate | 172 | + user.activate |
189 | task = ChangePassword.create!(:requestor => user.person) | 173 | task = ChangePassword.create!(:requestor => user.person) |
190 | params = {:code => task.code, :password => 'secret', :password_confirmation => 's3cret'} | 174 | params = {:code => task.code, :password => 'secret', :password_confirmation => 's3cret'} |
191 | patch "/api/v1/new_password?#{params.to_query}" | 175 | patch "/api/v1/new_password?#{params.to_query}" |