carddav.feature 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Feature: carddav
  2. Scenario: Accessing a not existing addressbook of another user
  3. Given user "user0" exists
  4. When "admin" requests addressbook "user0/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/dav/addressbooks/users/"
  5. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  6. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  7. Scenario: Accessing a not shared addressbook of another user
  8. Given user "user0" exists
  9. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  10. When "user0" requests addressbook "admin/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/dav/addressbooks/users/"
  11. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  12. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  13. Scenario: Accessing a not existing addressbook of another user via legacy endpoint
  14. Given user "user0" exists
  15. When "admin" requests addressbook "user0/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/carddav/addressbooks/"
  16. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  17. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  18. Scenario: Accessing a not shared addressbook of another user via legacy endpoint
  19. Given user "user0" exists
  20. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  21. When "user0" requests addressbook "admin/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/carddav/addressbooks/"
  22. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  23. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  24. Scenario: Accessing a not existing addressbook of myself
  25. Given user "user0" exists
  26. When "user0" requests addressbook "admin/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/dav/addressbooks/users/"
  27. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  28. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  29. Scenario: Creating a new addressbook
  30. When "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  31. Then "admin" requests addressbook "admin/MyAddressbook" with statuscode "207" on the endpoint "/remote.php/dav/addressbooks/users/"
  32. Scenario: Accessing ones own contact
  33. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  34. Given "admin" uploads the contact "bjoern.vcf" to the addressbook "MyAddressbook"
  35. When Downloading the contact "bjoern.vcf" from addressbook "MyAddressbook" as user "admin"
  36. Then The following HTTP headers should be set
  37. |Content-Disposition|attachment; filename*=UTF-8''bjoern.vcf; filename="bjoern.vcf"|
  38. |Content-Type|text/vcard; charset=utf-8|
  39. |Content-Security-Policy|default-src 'none';|
  40. |X-Content-Type-Options |nosniff|
  41. |X-Frame-Options|SAMEORIGIN|
  42. |X-Permitted-Cross-Domain-Policies|none|
  43. |X-Robots-Tag|noindex, nofollow|
  44. |X-XSS-Protection|1; mode=block|
  45. Scenario: Exporting the picture of ones own contact
  46. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  47. Given "admin" uploads the contact "bjoern.vcf" to the addressbook "MyAddressbook"
  48. When Exporting the picture of contact "bjoern.vcf" from addressbook "MyAddressbook" as user "admin"
  49. Then The following HTTP headers should be set
  50. |Content-Disposition|attachment; filename=bjoern.vcf.jpg|
  51. |Content-Type|image/jpeg|
  52. |Content-Security-Policy|default-src 'none';|
  53. |X-Content-Type-Options |nosniff|
  54. |X-Frame-Options|SAMEORIGIN|
  55. |X-Permitted-Cross-Domain-Policies|none|
  56. |X-Robots-Tag|noindex, nofollow|
  57. |X-XSS-Protection|1; mode=block|
  58. Scenario: Create addressbook request for non-existing addressbook of another user
  59. Given user "user0" exists
  60. When "user0" sends a create addressbook request to "admin/MyAddressbook2" on the endpoint "/remote.php/dav/addressbooks/"
  61. Then The CardDAV HTTP status code should be "404"
  62. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  63. And The CardDAV error message is "File not found: admin in 'addressbooks'"
  64. Scenario: Create addressbook request for existing addressbook of another user
  65. Given user "user0" exists
  66. When "admin" creates an addressbook named "MyAddressbook2" with statuscode "201"
  67. When "user0" sends a create addressbook request to "admin/MyAddressbook2" on the endpoint "/remote.php/dav/addressbooks/"
  68. Then The CardDAV HTTP status code should be "404"
  69. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  70. And The CardDAV error message is "File not found: admin in 'addressbooks'"