[rspec-users] How far to go with ActiveRecord unit tests without hitting the database?
tom at experthuman.com
Sun Sep 16 04:05:31 EDT 2007
On 16 Sep 2007, at 06:43, Pat Maddox wrote:
> You can't assign mock objects to associations.
Actually I haven't had any trouble with e.g.
@company = Company.new :name => 'BigCo'
@mock_employee = mock_model(Employee, :name => 'Pat', := =>
true, :save => true)
@company.employees << @mock_employee
(To be followed by, for example, @mock_employee.should_receive
Is that unacceptable?
More information about the rspec-users