Set captcha length correctly, fix #5932

This commit is contained in:
Dennis Schubert 2015-05-06 23:24:09 +02:00 committed by Jonne Haß
parent f8b3836d1f
commit d27061d5d6
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,6 @@
SimpleCaptcha.setup do |sc|
sc.image_size = AppConfig.settings.captcha.image_size
sc.length = [1, [AppConfig.settings.captcha_length.to_i, 12].min].max
sc.length = [1, [AppConfig.settings.captcha.captcha_length.to_i, 12].min].max
sc.image_style = AppConfig.settings.captcha.image_style
sc.distortion = AppConfig.settings.captcha.distortion
end

View file

@ -0,0 +1,7 @@
require "spec_helper"
describe "ensure configuration effects" do
it "sets the captcha length as required" do
expect(SimpleCaptcha.length).to eq(AppConfig.settings.captcha.captcha_length.to_i)
end
end