Rspec Self Class Method Access

I have a class that have self methods.

Class X < ActiveRecord::Base
self.do_something { puts ‘do something’ }
end

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.

Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs