From 85d213a0ece59472fcd1690d3dcdf85beb5d5f62 Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Thu, 12 Jan 2023 10:07:35 +0545 Subject: [PATCH] [tests-only][full-ci] Added tests for checking version of file uploaded with same mtime twice (#5379) --- .../coreApiVersions/fileVersions.feature | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/acceptance/features/coreApiVersions/fileVersions.feature b/tests/acceptance/features/coreApiVersions/fileVersions.feature index e2f6a0ce6f..38a5ef2a7a 100644 --- a/tests/acceptance/features/coreApiVersions/fileVersions.feature +++ b/tests/acceptance/features/coreApiVersions/fileVersions.feature @@ -531,3 +531,26 @@ Feature: dav-versions When user "Alice" restores version index "1" of file "/davtest.txt" using the WebDAV API Then the HTTP status code should be "204" And the content of file "/davtest.txt" for user "Alice" should be "Old Test Content." + + @issue-5010 + Scenario: Upload the same file twice with the same mtime and a version is available + Given user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + Then the HTTP status code should be "204" + And the version folder of file "/file.txt" for user "Alice" should contain "1" element + + @issue-5010 + Scenario: Upload the same file more than twice with the same mtime and only one version is available + Given user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + Then the HTTP status code should be "204" + And the version folder of file "/file.txt" for user "Alice" should contain "1" element + + @issue-5010 + Scenario: Upload the same file twice with the same mtime and no version after restoring + Given user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API + When user "Alice" restores version index "1" of file "/file.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the version folder of file "/file.txt" for user "Alice" should contain "0" element \ No newline at end of file