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

13/04/2023 (about 1 year ago)
·
omniauth oauth2 github oauth rails testing oauth testing faker mock login

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


0
Sign in to join the conversation