Added test coverage for upsert()