rspec/rspec-rails — pull request #1238 by JonRowe (2014-11-29 07:14:14+00:00)
Title: Make `instance_double` et al work with ActiveRecord columns.

When we create an `instance_double` of an ActiveRecord object, we traditionally haven't been able to verify methods created by database columns. By calling a method on the class we can actually force Rails to create the dynamic methods on the class, and thus an `instance_double` will now work with a column method. This utilises a new extension hook in `rspec-mock`s that allows us to customise the creation process of verified doubles.

This comes out of work with @maxim-filimonov at Railscamp.