Let’s say we have the following code:
class Post < ActiveRecord::Base
def self.fix_published_times
where(:published => true, :published_at => nil).limit(5).each do |post
post.fix_published_at!
end
end
end
How should I spec Post#fix_published__at! with should_receive?
Something along this lines of this should work: