Add test for moving notes between posts.

This commit is contained in:
evazion
2016-10-19 22:39:08 -05:00
parent 4c1949f1c8
commit d2f3027294

View File

@@ -47,6 +47,13 @@ class NotesControllerTest < ActionController::TestCase
@note.reload
assert_equal("xyz", @note.body)
end
should "not allow changing the post id to another post" do
@other = FactoryGirl.create(:post)
post :update, {:format => "json", :id => @note.id, :note => {:post_id => @other.id}}, {:user_id => @user.id}
assert_not_equal(@other.id, @note.reload.post_id)
end
end
context "destroy action" do