# Response Assertion API in test scripts

**URL:** <https://community.postman.com/t/response-assertion-api-in-test-scripts/596>\
**Category:** Help Hub\
**Tags:** responseassertion, testscripts\
**Created:** [January 3, 2018, 11:08am UTC](https://community.postman.com/t/response-assertion-api-in-test-scripts/596 "2018-01-03T11:08:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kency](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@Kency](https://community.postman.com/u/Kency)\
**Post date:** [January 3, 2018, 11:08am UTC](https://community.postman.com/t/response-assertion-api-in-test-scripts/596/1 "2018-01-03T11:08:48Z")

</div>

Hello,

I was using the below as mentioned in the postman [documentation](https://www.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference):

pm.response.to.be.badRequest

The request that I fire is actually giving me a Bad Request but somehow the assertion failed with the below message:  
**_AssertionError | expected response to have status reason ‘BADREQUEST’ but got ‘BAD REQUEST’_**

 ![postmanIssue](https://us1.discourse-cdn.com/getpostman/original/3X/b/c/bc6b824e17cf7d844318312be16b604161d0bc18.png)

Let me know what is wrong here.

Postman Version:  
Postman helps you develop APIs faster  
Postman for Linux  
Version 5.5.0

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [July 5, 2018, 8:07pm UTC](https://community.postman.com/t/response-assertion-api-in-test-scripts/596/2 "2018-07-05T20:07:20Z")

</div>

Hey @Kency, this has been fixed in recent versions of the Postman app, see [https://github.com/postmanlabs/postman-app-support/issues/4348](https://github.com/postmanlabs/postman-app-support/issues/4348) for more context 😄
