This might be due to using transactional fixtures, which does a rollback
on anything the tests do to the test db.
b
Vic wrote:> 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 fc.save! returns
"true",
> nothing is written in the database...
>
> Thanks for your help,
> Vic
>
> 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
> end
>
> in the application:
> def add_criterion
> fc = FilterCriterion.new
> fc.save! # this returns true (but no save)..
> end
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---