Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/simple_captcha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ module SimpleCaptcha
mattr_accessor :point_size
@@point_size = 22

# the expected captcha value for test
mattr_accessor :test_captcha
@@test_captcha = 'test'

def self.add_image_style(name, params = [])
SimpleCaptcha::ImageHelpers.image_styles.update(name.to_s => params)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/simple_captcha/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module ControllerHelpers #:nodoc
# redirect_to :action => "myaction"
# end
def simple_captcha_valid?
return true if Rails.env.test?
return true if Rails.env.test? and params[:captcha] == SimpleCaptcha.test_captcha

if params[:captcha]
data = SimpleCaptcha::Utils::simple_captcha_value(params[:captcha_key] || session[:captcha])
Expand Down