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