diff --git a/spec/captcha_spec.rb b/spec/captcha_spec.rb index 6b971f6..4e55dc3 100644 --- a/spec/captcha_spec.rb +++ b/spec/captcha_spec.rb @@ -11,7 +11,7 @@ describe RuCaptcha::Captcha do end it 'should not include [0ol1]' do - 10000.times do + 10_000.times do expect(RuCaptcha::Captcha.random_chars_without_cache).not_to match(/[0ol1]/i) end end diff --git a/spec/controller_helpers_spec.rb b/spec/controller_helpers_spec.rb index 34a1e5a..f1db008 100644 --- a/spec/controller_helpers_spec.rb +++ b/spec/controller_helpers_spec.rb @@ -48,7 +48,7 @@ describe RuCaptcha do end describe 'Incorrect chars' do - it "should work" do + it 'should work' do simple.session[:_rucaptcha_at] = Time.now.to_i - 60 simple.session[:_rucaptcha] = 'abcd' simple.params[:_rucaptcha] = 'd123' @@ -57,7 +57,7 @@ describe RuCaptcha do end describe 'Expires Session key' do - it "should work" do + it 'should work' do simple.session[:_rucaptcha_at] = Time.now.to_i - 121 simple.session[:_rucaptcha] = 'abcd' simple.params[:_rucaptcha] = 'abcd' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 553994d..75c1ef6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,9 +6,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'rucaptcha' tmp_path = File.join(File.dirname(__FILE__), '../tmp') -if !File.exists?(tmp_path) - Dir.mkdir(tmp_path) -end +Dir.mkdir(tmp_path) unless File.exist?(tmp_path) module Rails class << self @@ -19,7 +17,7 @@ module Rails end RuCaptcha.configure do - self.len = 2 + self.len = 2 self.font_size = 48 - self.implode = 0.111 + self.implode = 0.111 end