简体   繁体   中英

Rails + SAML + RSpec + Capybara Testing

I have a rails 5 app that uses omniauth-saml for authentication. For feature testing with capybara and rspec I currently bypass the saml auth flow but am looking for a better solution that exercises at least some of the saml auth flow without actually hitting our SAML endpoints.

I was thinking perhaps stubbing the methods or perhaps using webmock .

Has any found a solution they love?

You might be able to use OneLogin's SAML Test Connector to set up a fake SAML IDP.

This would make your tests reliant on network connectivity, but would be a more complete test than stubbing out the method calls.

I think Webmock might be a good solution too, although that would require more setup on your end.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM