Update README.md

This commit is contained in:
Jason Lee 2016-05-27 11:51:51 +08:00
parent 81252623a2
commit 38b6ac8ae1
1 changed files with 15 additions and 0 deletions

View File

@ -111,6 +111,8 @@ And if you are use Devise, you can read this to add validation: [RuCaptcha with
### Write your test skip captcha validation
for RSpec
```rb
describe 'sign up and login', type: :feature do
before do
@ -120,3 +122,16 @@ describe 'sign up and login', type: :feature do
it { ... }
end
```
for MiniTest
```rb
class ActionDispatch::IntegrationTest
def sign_in(user)
ActionController::Base.any_instance.stubs(:verify_rucaptcha?).returns(true)
post user_session_path \
'user[email]' => user.email,
'user[password]' => user.password
end
end
```