I agree that this problem exists, but I also feel that there is a better solution than whats listed. Stories should be given points for their complexity and not for the time it takes. Additionally stories should only be business oriented, so things like automated testing don't get their own stories.
Since automated testing does take time your team velocity is what's affected, and no one has control over team velocity once a sprint has started. Quality issues that recur affect the calculated velocity and one off quality things (like setting up continuous integration) should add a buffer to the velocity. This should be discussed in sprint planning so transparency is maintained.
Since automated testing does take time your team velocity is what's affected, and no one has control over team velocity once a sprint has started. Quality issues that recur affect the calculated velocity and one off quality things (like setting up continuous integration) should add a buffer to the velocity. This should be discussed in sprint planning so transparency is maintained.