You create the records. @bah = Bah.create! [1, 5, 22, 16].each { |amount| Foo.create! :amount => amount, :bah => @bah }
@bah.foos.should == 44 On 8/27/07, Rodrigo Alvarez Fernández <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know how would you test a method in a model that uses > complex a SQL query that joins several tables in order to make a > calculation. > > I suppose that I need fixtures, although my approach with rspec is to > avoid fixtures and isolate model specs, but none of both seems > possible in this case. Is there another way than fixtures? > > Thanks. > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users