Sha256: 388d2f86c734a2ac2e7753a0de1e4da44b55ebe459963aec41e93000183a3557

Contents?: true

Size: 708 Bytes

Versions: 2

Compression:

Stored size: 708 Bytes

Contents

require "#{File.dirname(File.expand_path(__FILE__))}/../../helper"

class TestActiveRecordCallbacHooks < Test::Unit::TestCase
  def setup
    @author = Author.create(:name => "Von Himler")
    @book = Book.create(:name => "Rise and Fall", :author => @author)
  end

  should "have callbacks functioning properly" do
    category = Category.new(:name => "Sweetness")
    category.book = @book
    category.author = @author

    assert_nothing_raised do
      category.save!
    end

    book = Book.create(:name => "Fall and Rise", :author => @author)
    category.book = book

    assert_nothing_raised do
      category.save!
    end

#    assert_nothing_raised do
      category.destroy
#    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_cleo-3.0.2 test/unit/acts_as_cleo_connection/test_active_record_callbacks.rb
acts_as_cleo-3.0.1 test/unit/acts_as_cleo_connection/test_active_record_callbacks.rb