Commit 22ae060c8367932c12bab2ac43503bf3670f4ef1

Authored by Evandro Junior
1 parent 3a43cd5e
Exists in master

rename_test_captcha_to_verify_captcha

lib/recaptcha_plugin.rb
... ... @@ -8,7 +8,7 @@ class RecaptchaPlugin < Noosfero::Plugin
8 8 _("Provides a plugin to Google reCAPTCHA.")
9 9 end
10 10  
11   - def test_captcha(*args)
  11 + def verify_captcha(*args)
12 12 remote_ip = args[0]
13 13 params = args[1]
14 14 environment = args[2]
... ...
test/unit/recaptcha_verification_test.rb
... ... @@ -53,7 +53,7 @@ class RecaptchaVerificationTest < ActiveSupport::TestCase
53 53 version = 1
54 54 setup_captcha(version)
55 55 validate_captcha(version)
56   - r = RecaptchaPlugin.new.test_captcha(@remoteip, @params, @environment)
  56 + r = RecaptchaPlugin.new.verify_captcha(@remoteip, @params, @environment)
57 57 assert_not_kind_of Hash, r
58 58 assert_equal true, r
59 59 end
... ... @@ -62,7 +62,7 @@ class RecaptchaVerificationTest < ActiveSupport::TestCase
62 62 version = 1
63 63 setup_captcha(version)
64 64 validate_captcha(version, false)
65   - r = RecaptchaPlugin.new.test_captcha(@remoteip, @params, @environment)
  65 + r = RecaptchaPlugin.new.verify_captcha(@remoteip, @params, @environment)
66 66 assert_kind_of Hash, r
67 67 end
68 68  
... ... @@ -70,7 +70,7 @@ class RecaptchaVerificationTest < ActiveSupport::TestCase
70 70 version = 2
71 71 setup_captcha(version)
72 72 validate_captcha(version)
73   - r = RecaptchaPlugin.new.test_captcha(@remoteip, @params, @environment)
  73 + r = RecaptchaPlugin.new.verify_captcha(@remoteip, @params, @environment)
74 74 assert_not_kind_of Hash, r
75 75 assert_equal true, r
76 76 end
... ... @@ -79,7 +79,7 @@ class RecaptchaVerificationTest < ActiveSupport::TestCase
79 79 version = 2
80 80 setup_captcha(version)
81 81 validate_captcha(version, false)
82   - r = RecaptchaPlugin.new.test_captcha(@remoteip, @params, @environment)
  82 + r = RecaptchaPlugin.new.verify_captcha(@remoteip, @params, @environment)
83 83 assert_kind_of Hash, r
84 84 assert_equal r[:user_message], _("Wrong captcha text, please try again")
85 85 end
... ... @@ -116,7 +116,7 @@ class RecaptchaVerificationTest < ActiveSupport::TestCase
116 116 validate_captcha(version, false)
117 117 rv = RecaptchaVerification.new
118 118 @params[:recaptcha_response_field] = nil
119   - hash = RecaptchaPlugin.new.test_captcha(@remoteip, @params, @environment)
  119 + hash = RecaptchaPlugin.new.verify_captcha(@remoteip, @params, @environment)
120 120 assert hash[:user_message], _('Captcha text has not been filled')
121 121 end
122 122  
... ...