adds to_s method testing on Excerpt

This commit is contained in:
Meeka 2013-12-30 12:23:41 -05:00
parent 3a0733deb9
commit 9652b7ef80
1 changed files with 11 additions and 0 deletions

View File

@ -56,6 +56,17 @@ class TestExcerpt < Test::Unit::TestCase
end
end
context "#to_s" do
should "return its content if no output present" do
assert_equal @excerpt.content, @excerpt.to_s
end
should "return its output if output present" do
@excerpt.output = "Fake Output"
assert_equal @excerpt.output, @excerpt.to_s
end
end
context "#inspect" do
should "contain the excerpt id" do
assert_include @excerpt.inspect, @excerpt.id