Prevent mass assignment to Post#last_noted_at (#2704).
This commit is contained in:
@@ -103,6 +103,14 @@ class PostsControllerTest < ActionController::TestCase
|
||||
@post.reload
|
||||
assert_equal("bbb", @post.tag_string)
|
||||
end
|
||||
|
||||
should "ignore restricted params" do
|
||||
post :update, {:id => @post.id, :post => {:last_noted_at => 1.minute.ago}}, {:user_id => @user.id}
|
||||
assert_redirected_to post_path(@post)
|
||||
|
||||
@post.reload
|
||||
assert_nil(@post.last_noted_at)
|
||||
end
|
||||
end
|
||||
|
||||
context "revert action" do
|
||||
|
||||
Reference in New Issue
Block a user