Moved assertion of code 11000 inside if (err)
Added a failing test for travis-ci