I have to persist some data in the database to test the interactions between two of my models. One model has a serial number attribute that is unique, so it must be entered once and only once. rake spec deletes all the data, allowing my tests to pass. . Running rspec under TextMate produces a fail, however, because the data in tables remain. This is somewhat inconsistent, too. Running it twice produces a pass. Any ideas? How can I ensure that the database -- or at least the tables for the two models -- is empty? -- Martin Streicher Fresh Pixels and Bytes (and now Commas!), Baked Daily http://www.linkedin.com/in/mstreicher email: martin.streicher at gmail.com gtalk: martin.streicher at gmail.com aim: horatiogadget phone: 919.741.4182
On Wed, Sep 24, 2008 at 9:23 AM, Martin Streicher < martin.streicher at gmail.com> wrote:> > I have to persist some data in the database to test the interactions > between two of my models. One model has a serial number attribute that is > unique, so it must be entered once and only once. > > rake spec deletes all the data, allowing my tests to pass. . Running rspec > under TextMate produces a fail, however, because the data in tables remain. > This is somewhat inconsistent, too. Running it twice produces a pass. > > Any ideas? How can I ensure that the database -- or at least the tables for > the two models -- is empty? >delete_all suggests itself. ///ark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080924/69fcf59a/attachment.html>
Seemingly Similar Threads
- Announcing a new Ruby journal
- [rspec/tm] When running the textmate bundle hook using command-r I get an error about missing rubygems
- rSpec (rev 2996), Rails (rev 8214): TextMate bundle problems
- TextMate File Type Detection for RSpec & Rails
- problems with textmate and rspec bundle