<br><br><div><span class="gmail_quote">On 7/6/07, <b class="gmail_sendername">David Chelimsky</b> <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 7/5/07, Daniel N <<a href="mailto:has.sox@gmail.com">has.sox@gmail.com</a>> wrote:<br>> Hi,<br>><br>> I'm very new to rspec so please be patient with me.<br>><br>> I've tried to take some of my tests out of the controller specs to check for
<br>> things that are rendered.<br>><br>> This has not worked so well, since my views have the controller method<br>><br>> current_user<br>><br>> in quite a few places.<br>><br>> Is there any way that I can define this so that my views will be executed?
<br>> Will this same thing occur for all helper methods that are definied in the<br>> controller?<br><br>If I understand you correctly, you are trying to take tests for views<br>that were previously rails functional tests and turn them into rspec
<br>view examples. If that is the case, you should be able to do this:<br><br>template.stub!(:current_user).and_return(mock_model(User))<br><br>If not, please provide an explicit example so we can better understand<br>what you're talking about.
<br><br>Cheers,<br>David</blockquote><div><br><br>Thanx David, <br><br>That looks like what I was looking for. <br><br>I will try it when I get home.<br><br>Cheers<br>Daniel<br> </div><br></div><br>