Format code
This commit is contained in:
parent
2e2a8f6f8a
commit
19dc27e71b
|
@ -11,7 +11,7 @@ describe RuCaptcha::Captcha do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not include [0ol1]' do
|
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)
|
expect(RuCaptcha::Captcha.random_chars_without_cache).not_to match(/[0ol1]/i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,7 +48,7 @@ describe RuCaptcha do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'Incorrect chars' do
|
describe 'Incorrect chars' do
|
||||||
it "should work" do
|
it 'should work' do
|
||||||
simple.session[:_rucaptcha_at] = Time.now.to_i - 60
|
simple.session[:_rucaptcha_at] = Time.now.to_i - 60
|
||||||
simple.session[:_rucaptcha] = 'abcd'
|
simple.session[:_rucaptcha] = 'abcd'
|
||||||
simple.params[:_rucaptcha] = 'd123'
|
simple.params[:_rucaptcha] = 'd123'
|
||||||
|
@ -57,7 +57,7 @@ describe RuCaptcha do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'Expires Session key' do
|
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_at] = Time.now.to_i - 121
|
||||||
simple.session[:_rucaptcha] = 'abcd'
|
simple.session[:_rucaptcha] = 'abcd'
|
||||||
simple.params[:_rucaptcha] = 'abcd'
|
simple.params[:_rucaptcha] = 'abcd'
|
||||||
|
|
|
@ -6,9 +6,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
||||||
require 'rucaptcha'
|
require 'rucaptcha'
|
||||||
|
|
||||||
tmp_path = File.join(File.dirname(__FILE__), '../tmp')
|
tmp_path = File.join(File.dirname(__FILE__), '../tmp')
|
||||||
if !File.exists?(tmp_path)
|
Dir.mkdir(tmp_path) unless File.exist?(tmp_path)
|
||||||
Dir.mkdir(tmp_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
module Rails
|
module Rails
|
||||||
class << self
|
class << self
|
||||||
|
@ -19,7 +17,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
RuCaptcha.configure do
|
RuCaptcha.configure do
|
||||||
self.len = 2
|
self.len = 2
|
||||||
self.font_size = 48
|
self.font_size = 48
|
||||||
self.implode = 0.111
|
self.implode = 0.111
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue