# #124 Test omniauth login with controller (integration) tests

- URL: https://superails.com/posts/rails-7-124-test-omniauth-login-with-controller-integration-tests
- Published: 2023-04-13
- Duration: 09:38
- Access: free
- Topics: omniauth, oauth2, oauth testing, rails testing

Testing is a very important part of app development that I haven't covered a lot before.

Previously we've added oAuth login for Microsoft & Github. Now, let's mock omniauth authentication with both oAuth providers in our tests.

Episode source code: https://github.com/corsego/124-test-omniauth/commit/66d848b5405457704e8411865b3f7812b8d43262
Based on this blogpost: https://blog.corsego.com/testing-omniauth

0:00 walk through initial app setup
1:30 run test suite, fix errors
3:40 test Github omniauth authentication
6:04 test Microsoft Azure omniauth authentication
9:17 final test run

## Chapters

- 0:00 walk through initial app setup
- 1:30 run test suite, fix errors
- 3:40 test Github omniauth authentication
- 6:04 test Microsoft Azure omniauth authentication
- 9:17 final test run
