Just a minor issue: I'd prefer the new rspec syntax here, e.g. use `allow(...).to receive(:....)` instead of `.stub`.

It's also consistent with the `expect(...)` calls already there..