mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Fix in file test
This commit is contained in:
parent
f3d6353f86
commit
edb361f150
1 changed files with 0 additions and 12 deletions
|
@ -185,18 +185,6 @@ func TestAddFile(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equalf(t, 200, code, "Response body: \n%v\n", resp)
|
assert.Equalf(t, 200, code, "Response body: \n%v\n", resp)
|
||||||
assert.Equalf(t, string(c1), resp.String(), "Response body: \n%v\n", resp)
|
assert.Equalf(t, string(c1), resp.String(), "Response body: \n%v\n", resp)
|
||||||
|
|
||||||
// authenticate as userB who has no access to the elements in the DB
|
|
||||||
token, err = helper.AuthenticateForTest(router, helper.UserBCredentials)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
// try to get a file to which user has no access
|
|
||||||
// should return unprocessable entity
|
|
||||||
code, resp, err = helper.TestEndpoint(router, token,
|
|
||||||
fmt.Sprintf("/api/v2/files/%v", newFileID), "GET", nil)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
assert.Equalf(t, 422, code, "Response body: \n%v\n", resp)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUpdateFile(t *testing.T) {
|
func TestUpdateFile(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue