[rspec-users] Cucumber not inserting record in db

Matt Wynne matt at mattwynne.net
Thu Mar 3 07:04:46 EST 2011

Hi Tushar,

On 3 Mar 2011, at 04:39, Tushar Gandhi wrote:

> Hi,
> I am trying to learn Cucumber. I have followed the tutorial on
> "http://www.ultrasaurus.com/sarahblog/2008/12/rails-2-day-3-behavior-driven-development/"
> Everything is working fine but my problem is it is not inserting any
> record in either development or test database.
> Can anyone tell me IS it the behaviour of the Cucumber or Am I missing
> something?
> Thanks,
> Tushar

What's probably confused you is that, assuming you're using a Rails app, Cucumber uses Rails' built-in 'transactional fixtures' feature for tests. This means that the test runs inside a transaction which is rolled back at the end of the test, so if you look at the database from outside that process - even during the test run - you won't be able to see the data.

Have a look at log/test.log and you should see some SQL statements running.

> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users


matt at mattwynne.net
07974 430184

More information about the rspec-users mailing list