Alan Smith
2008-Apr-15 16:57 UTC
Why does it still call transaction items with transaction support turned off?
I am pulling my hair out here (and I don''t have much to spare.) I changed Line 22 of test_helper.rb to read: self.use_transactional_fixtures = false #trying to get things to work However, I am still getting the following error when I run the task unit test. (source at bottom of message) 1) Error: test_create_read_update_delete(TaskTest): SystemStackError: stack level too deep /Users/alan/Projects/superb/vendor/plugins/acts_as_taggable_on_steroids/lib/acts_as_taggable.rb:220:in `reload_without_tag_list'' /Users/alan/Projects/superb/vendor/plugins/acts_as_taggable_on_steroids/lib/acts_as_taggable.rb:220:in `reload'' /Users/alan/Projects/superb/vendor/plugins/betternestedset/lib/better_nested_set.rb:161:in `before_destroy'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `send'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `callback'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:294:in `destroy_without_transactions'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'' ./test/unit/task_test.rb:29:in `test_create_read_update_delete'' /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/testing/default.rb:7:in `run'' I am TRYING to be good and run tests, but since this works in the actual code but FAILS in my testing, it is discouraging me from writing more tests. ANY help would be GREATLY appreciated... Thanks!! --Alan (source code for test) def test_create_read_update_delete adminUser = User.find_by_login(''admin'') # create a new task task1 = Task.new(:description => "Description", :done => false, :user => adminUser) assert task1.save; # read back task task2 = Task.find(task1.id) # compare the descriptions assert_equal task1.description, task2.description # mark as done task2.done = true # save the changes assert task2.save # gets killed assert task2.destroy 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 -~----------~----~----~----~------~----~------~--~---