← Back to Home

All posts tagged “testing”

Phoenix end-to-end testing in real life

https://i.imgur.com/0JNPevA.png

There are lots of articles on testing in Elixir, and probably ten times as many for each Javascript frontend framework. But what if we want to test all of it together? - Be advised that end-to-end tests do not replace unit and integration tests on either the backend or frontend, however, I think they do have their place in a good test suite for the following reasons:

Read more →

Elixir: Testing protected Phoenix controllers

A common problem

Testing protected endpoints in Phoenix controllers is a topic that sparks confusion - at best, and controversy at worst - amongst a surprising lot of people. When using Guardian or other pluggable ways of authorizing requests, this behaviour has to be taken into consideration for controller tests. Multiple pull requests in the Guardian repository were working towards a solution for this, Guardian Backdoor, which has now been moved into its own repository.

While this will certainly solve this issue for Guardian users in the future, let's explore a simple, fast approach for authorization bypassing that can be used with any kind of plug based authentication pipeline.

Read more →