Permalink
Browse files

add tests to make content presence dependent on type instead of (poss…

…ibly blank) data
  • Loading branch information...
1 parent 2b7eb97 commit 0c64c2129d4b281879059a17a9017088da11f7dd S. Brent Faulkner committed Jan 20, 2009
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/sequel_container_test.rb
@@ -72,4 +72,22 @@ def test_should_contain_html
assert_equal Dir.tmpdir+"/companies/#{company.id}/biography.html", company.biography_path
assert_equal "/companies/#{company.id}/biography.html", company.biography_url
end
+
+ def test_should_be_empty_container_when_type_is_nil
+ company = Company.create :biography_data => ''
+ assert company.reload
+ assert !company.biography?
+ end
+
+ def test_should_be_empty_container_when_type_is_blank
+ company = Company.create :biography_type => '', :biography_data => ''
+ assert company.reload
+ assert !company.biography?
+ end
+
+ def test_should_contain_empty_document_when_type_is_set
+ company = Company.create :biography_type => 'text/plain', :biography_data => ''
+ assert company.reload
+ assert company.biography?
+ end
end

0 comments on commit 0c64c21

Please sign in to comment.