add test cases

This commit is contained in:
albert
2013-03-22 19:20:38 -04:00
parent d1127da13f
commit dca946b2b8
2 changed files with 18 additions and 0 deletions

View File

@@ -44,6 +44,8 @@ class NoteTest < ActiveSupport::TestCase
assert_equal(1, @note.versions.count)
assert_equal(@note.body, @note.versions.first.body)
assert_equal(1, @note.version)
assert_equal(1, @note.versions.first.version)
end
should "update the post's last_noted_at field" do
@@ -92,7 +94,9 @@ class NoteTest < ActiveSupport::TestCase
@note.update_attributes(:body => "fafafa")
end
assert_equal(2, @note.versions.count)
assert_equal(2, @note.versions.last.version)
assert_equal("fafafa", @note.versions.last.body)
assert_equal(2, @note.version)
end
context "for a note-locked post" do