Skip to content

Commit d693944

Browse files
authored
Merge pull request #426 from AndyStabler/allow-symbol-actions
Permit actions as symbol
2 parents d0de0da + e7b95a7 commit d693944

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/recaptcha.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def self.hostname_valid?(hostname, validation)
125125
def self.action_valid?(action, expected_action)
126126
case expected_action
127127
when nil, FalseClass then true
128-
else action == expected_action
128+
else action == expected_action.to_s
129129
end
130130
end
131131

test/verify_enterprise_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ def initialize
288288
assert_nil @controller.flash[:recaptcha_error]
289289
end
290290

291+
it "passes with a symbol that matches" do
292+
assert verify_recaptcha(action: :homepage)
293+
assert_nil @controller.flash[:recaptcha_error]
294+
end
295+
291296
it "passes with nil" do
292297
assert verify_recaptcha(action: nil)
293298
assert_nil @controller.flash[:recaptcha_error]

0 commit comments

Comments
 (0)