mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
tests for http options
This commit is contained in:
@@ -119,4 +119,21 @@ void main() {
|
||||
test('Testing hashcode', () {
|
||||
expect(responseModel.hashCode, greaterThan(0));
|
||||
});
|
||||
|
||||
test('Testing fromResponse for OPTIONS method', () async {
|
||||
var responseRec = await sendHttpRequest(
|
||||
requestModelOptions1.id,
|
||||
requestModelOptions1.apiType,
|
||||
requestModelOptions1.httpRequestModel!,
|
||||
defaultUriScheme: kDefaultUriScheme,
|
||||
noSSL: false,
|
||||
);
|
||||
|
||||
final responseData = responseModel.fromResponse(response: responseRec.$1!);
|
||||
expect(responseData.statusCode, 200);
|
||||
expect(responseData.headers?['access-control-allow-methods'], 'GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS');
|
||||
expect(responseData.headers?['access-control-allow-methods']?.contains("OPTIONS"), true);
|
||||
expect(responseData.headers?['allow'], 'GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS');
|
||||
expect(responseData.headers?['allow']?.contains("OPTIONS"), true);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user