Great, thanks for that,
d.
On 04/02/2008, Pat Maddox <[EMAIL PROTECTED]> wrote:
> Extract the company creation to a method, so that that method only
> builds one record at a time. Test that it works properly. Then you
> can keep the test that you have, verifying that it creates the right
> numb
Extract the company creation to a method, so that that method only
builds one record at a time. Test that it works properly. Then you
can keep the test that you have, verifying that it creates the right
number of records.
Pat
___
rspec-users mailing li
Thanks,
Point taken about less interaction with the database. The 'companies'
mock is an exact representation of the companies list returned by the
basecamp api which is why there's 37 records in there. I need to learn
to think more clearly about separation from the database I guess.
The point is
On Feb 4, 2008 5:24 AM, David Currin <[EMAIL PROTECTED]> wrote:
> I'm having trouble working out how to test a method that contains a
> loop. I'm new to rspec so not sure what the best way is to tackle
> this.
>
> class Company < ActiveRecord::Base
>
> def self.sync_with_basecamp
> companies = ba