Forum: Ruby on Rails Cannot save to test database

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C33f49f806747e6b46c632430a855578?d=identicon&s=25 Vic (Guest)
on 2007-03-20 03:02
Hi all,
I am having problems writing data in the test database. I have a
functional test method that calls a method in my application, which is
creating a new object and saving it. Although! returns "true",
nothing is written in the database...

Thanks for your help,

my method:
 def test_should_add_criterion
     get :add_criterion, { :id=>filters(:one).id }, {
:current_context_id=>1, :current_user_id=>1}
     old_count = FilterCriterion.count

in the application:
def add_criterion
 fc =! # this returns true (but no save)..
8310c5a7c769345114597bcdef111488?d=identicon&s=25 Ben Munat (Guest)
on 2007-03-20 19:03
(Received via mailing list)
This might be due to using transactional fixtures, which does a rollback
on anything the tests do to the test db.

This topic is locked and can not be replied to.