(#506) - putAttachment don't respect rev parameter

adds test and fix.