Extract method from code in RSpec `after` hook, add spec for it.
WIP