This commit is contained in:
albert
2013-03-26 20:55:58 -04:00
parent 5897aa2ef6
commit fac215141d
2 changed files with 15 additions and 1 deletions

View File

@@ -390,6 +390,18 @@ class PostTest < ActiveSupport::TestCase
setup do
@parent = FactoryGirl.create(:post)
end
context "that has been deleted" do
setup do
@parent.update_column(:is_deleted, true)
end
should "not update the parent relationships" do
@post.update_attributes(:tag_string => "aaa parent:#{@parent.id}")
@post.reload
assert_nil(@post.parent_id)
end
end
should "update the parent relationships for both posts" do
@post.update_attributes(:tag_string => "aaa parent:#{@parent.id}")