Last Updated: February 25, 2016
·
8.441K
· ducknorris

How to test private methods with RSpec

Created an anonymous subclass of ApplicationController.

Then expose the protected / private method that you wanna test as public methods.

You can go and test them directly now.

Example bellow (from Rails w/ Devise):

Picture