From 583bb1f3a9413c0eb14bb23655b69846382a35d3 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 6 Sep 2018 19:41:16 +0800 Subject: [PATCH] Fix test --- spec/captcha_spec.rb | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/spec/captcha_spec.rb b/spec/captcha_spec.rb index 4a6c3a3..27dafff 100644 --- a/spec/captcha_spec.rb +++ b/spec/captcha_spec.rb @@ -12,14 +12,14 @@ describe RuCaptcha do describe '.create' do it 'should len equal config.len' do - res = RuCaptcha.create(0, 5, 1) + res = RuCaptcha.create(0, 5, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(5) expect(res[1]).not_to eq(nil) end it 'should work with color style' do - res = RuCaptcha.create(1, 5, 1) + res = RuCaptcha.create(1, 5, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(5) expect(res[1]).not_to eq(nil) @@ -48,49 +48,63 @@ describe RuCaptcha do end it 'should len equal 3' do - res = RuCaptcha.create(1, 3, 1) + res = RuCaptcha.create(1, 3, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(3) expect(res[1]).not_to eq(nil) end it 'should len equal 4' do - res = RuCaptcha.create(1, 4, 1) + res = RuCaptcha.create(1, 4, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(4) expect(res[1]).not_to eq(nil) end it 'should len equal 5' do - res = RuCaptcha.create(1, 5, 1) + res = RuCaptcha.create(1, 5, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(5) expect(res[1]).not_to eq(nil) end it 'should len equal 6' do - res = RuCaptcha.create(1, 6, 1) + res = RuCaptcha.create(1, 6, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(6) expect(res[1]).not_to eq(nil) end it 'should len equal 7' do - res = RuCaptcha.create(1, 7, 0) + res = RuCaptcha.create(1, 7, 0, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(7) expect(res[1]).not_to eq(nil) end + it 'should work with outline enable' do + res = RuCaptcha.create(1, 7, 1, 1) + expect(res.length).to eq(2) + expect(res[0].length).to eq(7) + expect(res[1]).not_to eq(nil) + end + + it 'should work with outline disable' do + res = RuCaptcha.create(1, 5, 1, 0) + expect(res.length).to eq(2) + expect(res[0].length).to eq(5) + expect(res[1]).not_to eq(nil) + end + it 'should work with strikethrough enable' do - res = RuCaptcha.create(1, 7, 1) + res = RuCaptcha.create(1, 7, 1, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(7) expect(res[1]).not_to eq(nil) end it 'should work with strikethrough disable' do - res = RuCaptcha.create(1, 7, 0) + res = RuCaptcha.create(1, 7, 0, 1) expect(res.length).to eq(2) expect(res[0].length).to eq(7) expect(res[1]).not_to eq(nil)