Product.yml file is..
abcd:
id: 1
title: xyz
description: Software Testing Engineer
image_url: http://.../sk_svn_small.jpg
price: 29.95
date_available: 2005-01-26 00:00:00
automation_book:
id: 2
title: Pragmatic Project Automation
description: How to automate your project
image_url: http://.../sk_auto_small.jpg
price: 29.95
date_available: 2004-07-01 00:00:00
future_proof_book:
id: 3
title: Future-Proofing Your Tests
description: How to beat the clock
image_url: http://.../future.jpg
price: 29.95
date_available: 2005-04-27 00:00:00
and
product.rb file contains...
require File.dirname(__FILE__) + '/../test_helper'
class ProductTest < Test::Unit::TestCase
fixtures :products
def setup
@product = Product.find(:all)
end
# Replace this with your real tests.
def test_create
assert_kind_of Product, @product
assert_equal 1, @product.id
assert_equal "xyz", @product.title
assert_equal "Software Testing Engineer", @product.description
assert_equal "http://.../sk_svn_small.jpg", @product.image_url
assert_equal 29.95, @product.price
assert_equal "2005-01-26 00:00:00",
@product.date_available_before_type_cast
end
end
Last edited by bkchoudhary (2007-01-18 01:02:13)