uses simple_captcha instead of recaptcha [#51]

This commit is contained in:
rgarcia
2015-08-10 20:24:56 +02:00
parent ee463f2ab1
commit 4839081ad2
29 changed files with 144 additions and 100 deletions

View File

@@ -1,36 +0,0 @@
require 'rails_helper'
describe RecaptchaHelper do
describe '#recaptchable?' do
it 'should be true if new record' do
debate = build(:debate)
expect(helper.recaptchable?(debate)).to be true
end
it 'should be false if existing record' do
debate = create(:debate)
expect(helper.recaptchable?(debate)).to be false
end
end
describe "#recaptcha_keys?" do
it "should be true if Recaptcha keys are configured" do
allow(Recaptcha.configuration).to receive(:public_key).and_return("akjasf")
allow(Recaptcha.configuration).to receive(:private_key).and_return("akjasf4532")
expect(helper.recaptcha_keys?).to be true
end
it "should be false if Recaptcha keys are not configured" do
allow(Recaptcha.configuration).to receive(:public_key).and_return(nil)
allow(Recaptcha.configuration).to receive(:private_key).and_return(nil)
expect(helper.recaptcha_keys?).to be false
end
end
end