The stub method in stubba gives me a warning when you stub :id (“Object#id will be deprecated; use Object#object_id”), which we seem to do fairly often with ActiveRecord objects. So we use a simple method called stub_object (which we wrote originally because we didn’t know “stub” existed):
object = Object.new
params.each do |attr, value|
It gives us syntax like this:
manufacturer = stub_object(:id => 5, :name => "Ford", :telephone_number => "555-888-999")
And our manufacturer object will respond to any calls to :id, :name, or :telephone_number, without the warning for :id.