What is the actual strategy to test strong params filtering in Rails controller with Rspec? (Except shoulda matchers) How to write failing test and then make it green?
as like you create or update object using strong parameters,it is also similar except one thing that normal you do like this:
post :create, book_id: @book.id
But in strong parameter you have to do like this:
post :create, {book_id: @book.id, comment: {user_id: 101, book_id: @book.id, description: "worth to buy"}}
you have to pass in nested parameters.