Add tests for by_category action