# Expected 'Forbidden' to deeply equal 'Method Not Allowed'

**URL:** <https://community.postman.com/t/expected-forbidden-to-deeply-equal-method-not-allowed/58134>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [February 26, 2024, 2:16pm UTC](https://community.postman.com/t/expected-forbidden-to-deeply-equal-method-not-allowed/58134 "2024-02-26T14:16:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaifut](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gaifut](https://community.postman.com/u/gaifut)\
**Post date:** [February 26, 2024, 2:16pm UTC](https://community.postman.com/t/expected-forbidden-to-deeply-equal-method-not-allowed/58134/1 "2024-02-26T14:16:03Z")

</div>

Hi guys, doing some tests for my assignment and getting this error:  
expected ‘Forbidden’ to deeply equal ‘Method Not allowed’.

So, basically, the test wants the error to be 405 and in the current state error 403 is raised. I assume this is not the right place to ask questions about the code, but concerning this message: what exactly does it mean in my case?

I saw similar topics but the content was a bit different. This ‘deeply equal’ is what gets me puzzled.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/0/a02f9f34f601e33ab4d0177dd11b27974a99846e.png)

Here is the request itself, I am getting back the message that I do not have the rights to execute this action (which lines well with my permissions as indeed the user is not supposed to have the rights to create tags).

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/d/1d2794cf503e10aec4947bd3550b877f9012ef0d.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 26, 2024, 3:11pm UTC](https://community.postman.com/t/expected-forbidden-to-deeply-equal-method-not-allowed/58134/2 "2024-02-26T15:11:31Z")

</div>

The “deeply equals” is being produced by the “to.be.eql” assertion which is part of the Chai assertion library.

[Expect / Should - Chai (chaijs.com)](https://www.chaijs.com/api/bdd/)

The best way to check for statuses is to use “pm.response.to.have.status” which is a special assertion linked to the pm.response function.

```auto
pm.test("Status code is 200", () => {
  pm.response.to.have.status(200);
});

```

---

<div class="post-metadata">

**Author:** ![gaifut](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gaifut](https://community.postman.com/u/gaifut)\
**Post date:** [February 27, 2024, 9:57am UTC](https://community.postman.com/t/expected-forbidden-to-deeply-equal-method-not-allowed/58134/3 "2024-02-27T09:57:06Z")

</div>

Thank you for the info!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [March 1, 2024, 9:57am UTC](https://community.postman.com/t/expected-forbidden-to-deeply-equal-method-not-allowed/58134/4 "2024-03-01T09:57:10Z")

</div>

Closed on March 1, 2024, 9:57am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
