Fixed the spec to set expectation when the error actually occurs