From d27061d5d673dbf77cdd449d31d513cdb93224f1 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Wed, 6 May 2015 23:24:09 +0200 Subject: [PATCH 1/2] Set captcha length correctly, fix #5932 --- config/initializers/setup_simple_captcha.rb | 2 +- spec/configuration_methods_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 spec/configuration_methods_spec.rb 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 From 51918a798ab021b28e5b6438def724ca8ccdda94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 6 May 2015 23:52:40 +0200 Subject: [PATCH 2/2] bump to 0.5.0.1 --- Changelog.md | 4 ++++ config/defaults.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 652eb5d9d..d7b0c1f77 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# 0.5.0.1 + +Use the correct setting for captcha length instead of defaulting to 1 always. + # 0.5.0.0 ## Major Sidekiq update diff --git a/config/defaults.yml b/config/defaults.yml index 008ce9661..c6f9b994c 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -4,7 +4,7 @@ defaults: version: - number: "0.5.0.0" # Do not touch unless doing a release, do not backport the version number that's in master but keep develop to always say "head" + number: "0.5.0.1" # Do not touch unless doing a release, do not backport the version number that's in master heroku: false environment: url: "http://localhost:3000/"