test(user-mypage): assert /user_mypage/update returns 401 without auth
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -212,4 +212,17 @@ public class UserMyPageControllerTests
|
|||||||
Assert.That(list[0].GetString(), Is.EqualTo("1211410310"));
|
Assert.That(list[0].GetString(), Is.EqualTo("1211410310"));
|
||||||
Assert.That(list[7].GetString(), Is.EqualTo("1218410310"));
|
Assert.That(list[7].GetString(), Is.EqualTo("1218410310"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Update_without_auth_returns_401()
|
||||||
|
{
|
||||||
|
using var factory = new SVSimTestFactory();
|
||||||
|
var client = factory.CreateClient(); // NO X-Test-Viewer-Id header
|
||||||
|
|
||||||
|
var body = JsonBody("""
|
||||||
|
{"select_type":0,"mypage_id":"0","mypage_id_list":[]}
|
||||||
|
""");
|
||||||
|
var response = await client.PostAsync("/user_mypage/update", body);
|
||||||
|
Assert.That(response.StatusCode, Is.EqualTo(System.Net.HttpStatusCode.Unauthorized));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user