Re: [rspec-users] RSpec and Factory Girl: Destroying an object

2010-05-14 Thread J. B. Rainsberger
Daniel Salmeron Amselem wrote: How would you test this method? Checking the database or mocking? Is there any advantage of using one over the other ? Hi, Dani. You originally wrote that you want "to check if my account object is being destroyed." I can think of a few reasons to check this: 1

Re: [rspec-users] RSpec and Factory Girl: Destroying an object

2010-05-14 Thread Daniel Salmeron Amselem
Hey Pat, thanks for replying. How would you test this method? Checking the database or mocking? Is there any advantage of using one over the other ? I don't really understand the benefits of using mocks, so could you tell me how would you write the test using both methods (mocking, and checking t

Re: [rspec-users] RSpec and Factory Girl: Destroying an object

2010-05-14 Thread Pat Maddox
On May 14, 2010, at 8:09 AM, Daniel Salmeron Amselem wrote: > Hi, > > I have a problem when testing the deletion of a record from the > database. I am using RSpec methods to check if my account object is > being destroyed. > > The factory creates an account object and saves it into the DB. Also

[rspec-users] RSpec and Factory Girl: Destroying an object

2010-05-14 Thread Daniel Salmeron Amselem
Hi, I have a problem when testing the deletion of a record from the database. I am using RSpec methods to check if my account object is being destroyed. The factory creates an account object and saves it into the DB. Also the two should_receive expectations seem to work. The problem is that when