Fix rules_test.go

This is smelly, but for now we copy a helper method from the metric
tests into rules.