rspec controller spec matchers
问题 With which matcher and how can I test if the @post_comment and @post_comment.user is properly assigned? expect(assigns(:post_comment)).to be_a_new(PostComment) is not working here. UPDATE: With the following setup I also get the following error. What should I change to be able to test the invalid attrs? Posts::PostCommentsController when user is logged in POST create with invalid attributes doesn't save the new product in the db Failure/Error: @post_comment.save! ActiveRecord::RecordInvalid: