Learn

3 ways of testing private methods in Rails

3 ways of testing private methods in Rails

Here’s a topic that pops up often especially when faced with the common task of testing controllers in Rails. We have some logic inside a private method and we want to test it somehow. And of course, like most things in ruby, there are a few ways to do it which we’ll look at next.

How to test controllers in Rails

How to test controllers in Rails

These days it seems like everyone is looking for faster tests and for good reason since loading the entire Rails framework on every test run makes the process way to slow. I want to address the issue of testing controllers in this article as I find it to be a confusing topic even for some of the more senior rails developers.