From a7526d74ae2e5b0da4e1b27c87a42ffc81f51ef2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= <danxuliu@gmail.com>
Date: Tue, 3 Sep 2019 17:42:06 +0200
Subject: [PATCH] Do not expect a 200 HTTP status code when updating a share
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This will be needed to test scenarios in which updating a share return a
different HTTP status code, like 401.

The assertion for the 200 HTTP status code was added in those scenarios
that tested updating a share (that is, those that were also checking the
OCS status code), but not in those in which updating a share was just a
preparatory step for the actual test (in the same way that the HTTP
status code is not checked in those tests when creating a share).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
---
 build/integration/features/bootstrap/Sharing.php            | 2 --
 build/integration/sharing_features/sharing-v1-part2.feature | 3 +++
 build/integration/sharing_features/sharing-v1.feature       | 5 +++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php
index abbac030e3b..4e62ea73c5d 100644
--- a/build/integration/features/bootstrap/Sharing.php
+++ b/build/integration/features/bootstrap/Sharing.php
@@ -218,8 +218,6 @@ trait Sharing {
 		} catch (\GuzzleHttp\Exception\ClientException $ex) {
 			$this->response = $ex->getResponse();
 		}
-
-		Assert::assertEquals(200, $this->response->getStatusCode());
 	}
 
 	public function createShare($user,
diff --git a/build/integration/sharing_features/sharing-v1-part2.feature b/build/integration/sharing_features/sharing-v1-part2.feature
index 9fbb4cda947..8127e892593 100644
--- a/build/integration/sharing_features/sharing-v1-part2.feature
+++ b/build/integration/sharing_features/sharing-v1-part2.feature
@@ -455,6 +455,7 @@ Feature: sharing
     When Updating last share with
       | permissions | 1 |
     Then the OCS status code should be "100"
+    And the HTTP status code should be "200"
 
   Scenario: Do not allow reshare to exceed permissions
     Given user "user0" exists
@@ -476,6 +477,7 @@ Feature: sharing
     When Updating last share with
       | permissions | 31 |
     Then the OCS status code should be "404"
+    And the HTTP status code should be "200"
 
   Scenario: Do not allow sub reshare to exceed permissions
     Given user "user0" exists
@@ -498,6 +500,7 @@ Feature: sharing
     When Updating last share with
       | permissions | 31 |
     Then the OCS status code should be "404"
+    And the HTTP status code should be "200"
 
   Scenario: Only allow 1 link share per file/folder
     Given user "user0" exists
diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature
index dd5cc9fff4f..37c411d987b 100644
--- a/build/integration/sharing_features/sharing-v1.feature
+++ b/build/integration/sharing_features/sharing-v1.feature
@@ -118,6 +118,7 @@ Feature: sharing
     And Updating last share with
       | expireDate | +3 days |
     And the OCS status code should be "100"
+    And the HTTP status code should be "200"
     And Getting info of last share 
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
@@ -150,6 +151,7 @@ Feature: sharing
     And Updating last share with 
       | password | publicpw |
     And the OCS status code should be "100"
+    And the HTTP status code should be "200"
     And Getting info of last share 
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
@@ -181,6 +183,7 @@ Feature: sharing
     And Updating last share with
       | permissions | 7 |
     And the OCS status code should be "100"
+    And the HTTP status code should be "200"
     And Getting info of last share 
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
@@ -212,6 +215,7 @@ Feature: sharing
     And Updating last share with
       | permissions | 4 |
     And the OCS status code should be "100"
+    And the HTTP status code should be "200"
     And Getting info of last share
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
@@ -243,6 +247,7 @@ Feature: sharing
     And Updating last share with
       | publicUpload | true |
     And the OCS status code should be "100"
+    And the HTTP status code should be "200"
     And Getting info of last share 
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
-- 
GitLab