diff --git a/config/initializers/setup_simple_captcha.rb b/config/initializers/setup_simple_captcha.rb index cdcb6c2a0..a79b48d45 100644 --- a/config/initializers/setup_simple_captcha.rb +++ b/config/initializers/setup_simple_captcha.rb @@ -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 diff --git a/spec/configuration_methods_spec.rb b/spec/configuration_methods_spec.rb new file mode 100644 index 000000000..a0d4e5d8f --- /dev/null +++ b/spec/configuration_methods_spec.rb @@ -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