Forum: Rails deployment Rspec Self Class Method Access

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
599e56d0e83a11592e3dc33254e0fbf0?d=identicon&s=25 Jan Y. (rocl)
on 2014-10-03 00:35
I have a class that have self methods.

Class X < ActiveRecord::Base
   self.do_something { puts 'do something' }

The model spec uses Factory Girl so an instance is created on the class.
When run rspec, do_something is not recognized.

How do I access X.do_something in rspec?  Also, please provide an
example of a small test (i.e., expect) with do_something.

This topic is locked and can not be replied to.