Last Updated: February 25, 2016
·
9.009K
· 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

Have a fresh tip? Share with Coderwall community!

Post
Post a tip