Topic: Help required about rspec


I am using rspec for my project.I am unable to get the behaviour(and also what's the use) of stub.
I have a code lookin like this in spec/controller

Book.stub(:search_page).with("page_number"=> "5")
Book.stub(:search_page).with("page_number"=> "5").and_return(@result)

I want to know the behaviour of the both the above statements.

Can anyone please help me out.
Thanks in advance.

Re: Help required about rspec

It will return the pages that are less than or equal to 5.