It feels a bit odd to have a method defined inside a method. Could we move it out (and maybe reuse for the other test)?