Rails 6: B-Sides and Rarities
These are the testing scenarios for the method:
And here is how we write these tests using brand new Action Cable testing utilities:
# to the described channel # `subscription` is a instance of the subscribed channel # and almost identical scenarios for `unsubscribe` action # we must subscribe first before calling unsubscribe
I have started using Active Storage since Rails 6 beta1: and even though it has some killer features (like the support for direct uploads out of the box), there are still a lot of rough edges. Action Cable testing was waiting for the showtime for three long years, but this little feature has definitely broken the record: “dirty” tracking methods for store accessors were first proposed in 2015. Now the PR is merged and in Rails 6 you can track changes to store attributes the same way you are used to when dealing with “vanilla” Active Record attributes:
There is some history behind this feature.
Source: evilmartians.com