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:inreload’
    /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:insend’
    /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:indestroy_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:intransaction’
    /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:intransaction’
    /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in
    destroy' ./test/unit/task_test.rb:29:intest_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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs