Rails 5.1 introduced assert_changes and assert_no_changes
blog.bigbinary.com