Forum: RSpec error: stack level too deep

Posted by aaron zhang (Guest)
on 2010-01-22 05:04
(Received via mailing list)
hi, guys

    i write follow code :

        it "The default should be based on readers to recommend a book
tastes" do
            @pick_book = mock_model(PickBook)
            @pick_books = [@pick_book]
            @recommend_count = 1

PickBook.should_receive(:recommend_books).with(@recommend_count,@user).and_return(@pick_books)

            post 'create','format'=>'json'
            assigns['pick_books'].should    equal(@pick_books)
            response.should be_success
            response.should have_text(@pick_books.to_json)
        end

    The following error occurred:
        stack level too deep


Best regards,
Posted by Pat Maddox (Guest)
on 2010-01-22 05:54
(Received via mailing list)
Please provide more context.  There should be a stack trace that tells 
you at which line the error occurs.

This problem typically occurs when you have a method that calls itself 
and has no return mechanism.  Sometimes that can be a sloppily 
implemented method_missing.

I can't see anything obviously wrong with what you've posted, but 
there's a lot missing:

* the rest of the spec code
* full error message
* relevant production code

Pat
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.