Permalink
Browse files

add tests for new container query method

  • Loading branch information...
1 parent 3ded3ce commit b9f7e4892c531be5525e4ff386d1f756d299a463 S. Brent Faulkner committed Jan 20, 2009
Showing with 4 additions and 0 deletions.
  1. +4 −0 test/sequel_container_test.rb
@@ -32,6 +32,7 @@ class SequelCascadingTest < Test::Unit::TestCase
def test_should_create_empty_container
company = Company.create
assert company.reload
+ assert !company.logo?
assert_nil company.logo_type
assert_nil company.logo_data
assert_nil company.logo_path
@@ -43,6 +44,7 @@ def test_should_contain_image
logo = File.read(File.dirname(__FILE__)+'/data/logo.gif')
company = Company.create :logo_type => 'image/gif', :logo_data => logo
assert company.reload
+ assert company.logo?
assert company.logo_image?
assert_equal logo, company.logo_data
assert_equal Dir.tmpdir+"/companies/#{company.id}/logo.gif", company.logo_path
@@ -53,6 +55,7 @@ def test_should_contain_text
bio = File.read(File.dirname(__FILE__)+'/data/bio.txt')
company = Company.create :biography_type => 'text/plain', :biography_data => bio
assert company.reload
+ assert company.biography?
assert !company.biography_image?
assert_equal bio, company.biography_data
assert_equal Dir.tmpdir+"/companies/#{company.id}/biography.txt", company.biography_path
@@ -63,6 +66,7 @@ def test_should_contain_html
bio = File.read(File.dirname(__FILE__)+'/data/bio.html')
company = Company.create :biography_type => 'text/html', :biography_data => bio
assert company.reload
+ assert company.biography?
assert !company.biography_image?
assert_equal bio, company.biography_data
assert_equal Dir.tmpdir+"/companies/#{company.id}/biography.html", company.biography_path

0 comments on commit b9f7e48

Please sign in to comment.