require File.dirname(__FILE__) + '/../test_helper' class BookTest < Test::Unit::TestCase fixtures :books, :pages, :versions def test_creation_with_home_page book = Book.create(:name => "Of the Ages") assert_equal 1, book.pages.size assert book.reload.existing_page_titles.include?("Home Page") assert_equal "Welcome to i2!", book.pages.first.versions.first.body assert_equal "i2", book.pages.first.versions.first.author.name end end