Format code

This commit is contained in:
Jason Lee 2016-05-23 15:11:04 +08:00
parent 2e2a8f6f8a
commit 19dc27e71b
3 changed files with 6 additions and 8 deletions

View File

@ -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

View File

@ -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'

View File

@ -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