diff --git a/test/functional/notes_controller_test.rb b/test/functional/notes_controller_test.rb index b93e2ac31..354736a01 100644 --- a/test/functional/notes_controller_test.rb +++ b/test/functional/notes_controller_test.rb @@ -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