You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
There should be an option to disable the validation entirely when testing (make it always return true) in the test environment or in the config file. I'm using Rspec.
For now in my controller specs i just use "controller.stub(:captcha_valid?).and_return(true)" but for some reason that doesn't work in my feature spec ... and I tried writing it in many ways:
allow(UserRegistrationController).to receive(:captcha_valid?).and_return true
UserRegistrationController.stub(:captcha_valid?).and_return(true)
... not working.
Some help would be greatly appreciated.
Thank you,
Dan
The text was updated successfully, but these errors were encountered:
In the end I managed to bypass the validation in my feature spec using "UserRegistrationController.any_instance.stub(:captcha_valid?).and_return(true)" ... but the validation still needs to be disabled in the test environment by default so that there won't be a need to keep stubbing it.
TylerRick
pushed a commit
to TylerRick/easy_captcha
that referenced
this issue
Jul 22, 2021
There should be an option to disable the validation entirely when testing (make it always return true) in the test environment or in the config file. I'm using Rspec.
For now in my controller specs i just use "controller.stub(:captcha_valid?).and_return(true)" but for some reason that doesn't work in my feature spec ... and I tried writing it in many ways:
allow(UserRegistrationController).to receive(:captcha_valid?).and_return true
UserRegistrationController.stub(:captcha_valid?).and_return(true)
... not working.
Some help would be greatly appreciated.
Thank you,
Dan
The text was updated successfully, but these errors were encountered: