Hi, I have problem storing the values into the test databse. so that i can''t cross check the values in the database. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thorsten Müller
2008-Sep-08 11:39 UTC
Re: Store test data into the testing database using rspec
> I have problem storing the values into the test databse. > > so that i can''t cross check the values in the database.What values? (fixtures, results generated by your code...?) What problems? (errors, nothing stored...?) Could you guys take 5 mins thinking before asking questions? assuming you talk about fixtures: Store them in folder spec/fixtures load them with rake spec:db:fixtures:load --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Sep-08 11:49 UTC
Re: Store test data into the testing database using rspec
On 8 Sep 2008, at 12:39, Thorsten Müller wrote:> >> I have problem storing the values into the test databse. >> >> so that i can''t cross check the values in the database. > > What values? (fixtures, results generated by your code...?) > What problems? (errors, nothing stored...?)Here''s a guess: are you expecting changes made by your tests to persist? This doesn''t happen: changes to the test database are rolled back after each test. Fred> > > Could you guys take 5 mins thinking before asking questions? > > assuming you talk about fixtures: > > Store them in folder spec/fixtures > > load them with > > rake spec:db:fixtures:load > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris
2008-Sep-08 12:34 UTC
Re: Store test data into the testing database using rspec
if you need preexisting values/objects in the database for specific tests, you should either create them in a setup block, create them with a factory method [see things like Factory Girl or Fixture Replacement], or load them via fixtures. if we had more specifics we could give more specific advice. hope that helps though. RSL On Mon, Sep 8, 2008 at 7:49 AM, Frederick Cheung <frederick.cheung@gmail.com> wrote:> > > On 8 Sep 2008, at 12:39, Thorsten Müller wrote: > > > > >> I have problem storing the values into the test databse. > >> > >> so that i can't cross check the values in the database. > > > > What values? (fixtures, results generated by your code...?) > > What problems? (errors, nothing stored...?) > > Here's a guess: are you expecting changes made by your tests to > persist? This doesn't happen: changes to the test database are rolled > back after each test. > > Fred > > > > > > > > Could you guys take 5 mins thinking before asking questions? > > > > assuming you talk about fixtures: > > > > Store them in folder spec/fixtures > > > > load them with > > > > rake spec:db:fixtures:load > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---