# "Stack Level Too Deep" issue in HABTM Unit / Functional Test

**URL:** <https://www.ruby-forum.com/t/stack-level-too-deep-issue-in-habtm-unit-functional-test/61501>\
**Category:** Rails\
**Created:** [May 24, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-issue-in-habtm-unit-functional-test/61501 "2006-05-24T17:10:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrpunkin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@mrpunkin](https://www.ruby-forum.com/u/mrpunkin)\
**Post date:** [May 24, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-issue-in-habtm-unit-functional-test/61501/1 "2006-05-24T17:10:37Z")

</div>

Hello guys. I was able to figure out that my “stack level too deep”  
error I was getting with my HABTM destroy method was the result of a bug  
in rails 1.0. I upgraded to 1.1.2 and now the views and any console-run  
commands for destroying AR objects linked together via HABTM work just  
fine.

I have HABTM setup between stories and submissions.

The issue is that the destroy methods in my unit tests and my functional  
tests are now giving me the “stack level too deep” issue. The unit test  
only does it on the submissions side of the HABTM relationship, but the  
functional test fails on the stories side.

---

<div class="post-metadata">

**Author:** ![mrpunkin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@mrpunkin](https://www.ruby-forum.com/u/mrpunkin)\
**Post date:** [May 24, 2006, 9:09pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-issue-in-habtm-unit-functional-test/61501/2 "2006-05-24T21:09:52Z")

</div>

Bryan C. wrote:

> Hello guys. I was able to figure out that my “stack level too deep”  
> error I was getting with my HABTM destroy method was the result of a bug  
> in rails 1.0. I upgraded to 1.1.2 and now the views and any console-run  
> commands for destroying AR objects linked together via HABTM work just  
> fine.
> 
> I have HABTM setup between stories and submissions.
> 
> The issue is that the destroy methods in my unit tests and my functional  
> tests are now giving me the “stack level too deep” issue. The unit test  
> only does it on the submissions side of the HABTM relationship, but the  
> functional test fails on the stories side.

No one? I can’t believe I am the only one that has run into this issue.

---

<div class="post-metadata">

**Author:** ![mrpunkin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@mrpunkin](https://www.ruby-forum.com/u/mrpunkin)\
**Post date:** [May 26, 2006, 5:26am UTC](https://www.ruby-forum.com/t/stack-level-too-deep-issue-in-habtm-unit-functional-test/61501/3 "2006-05-26T05:26:09Z")

</div>

Bryan,

Plenty of us use HABTM relationships every day and don’t have this  
problem, so it must be something you’re doing in your code. Given you  
haven’t posted any details of what you’re actually doing (code and  
stack trace), we can’t really help!
