<div dir="ltr">Hi David,<br><br>You were spot on.&nbsp; The generated authenticated_system_spec included AuthenticatedSystem.&nbsp; If I include AuthenticatedSystem into the SessionsController spec, then the specs all pass.&nbsp; This is a problem with the standard specs that resful_authentication builds for you - so I&#39;ll looking at getting those fixed..<br>
<br>I&#39;m kind of curios that the specs are testing these protected methods - I would have expected that&#39;s generally not a done thing as they&#39;re not a public part of the API?<br><br>I guess there&#39;s 3 options as to how to patch:<br>
&nbsp;1) include AuthenticatedSystem, or<br>&nbsp;2) change the specs to use .send, or<br>&nbsp;3) remove the specs that are calling protected methods.<br><br>Do you have any guidance on the best path forward here?<br><br>Cheers,<br><br>
Tim.<br><br><br><div class="gmail_quote">On Tue, Sep 2, 2008 at 3:15 PM, David Chelimsky <span dir="ltr">&lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Mon, Sep 1, 2008 at 6:22 PM, Tim Haines &lt;<a href="mailto:tmhaines@gmail.com">tmhaines@gmail.com</a>&gt; wrote:<br>
&gt; Hi there,<br>
&gt;<br>
&gt; I&#39;ve noticed something a little odd with the session_controller specs that<br>
&gt; are generated from the rails plugin restful_authentication. &nbsp;When they&#39;re<br>
&gt; run with all the other app specs (i.e. when I first fire up autospec) the<br>
&gt; specs all pass. &nbsp;However, if I touch the session_controller_spec file so<br>
&gt; only the session_controller specs are run, some fail with the error message<br>
&gt; protected method `logged_in?&#39; called for #&lt;SessionsController:0x19100e0&gt;<br>
&gt;<br>
&gt; Can anyone explain why this might be or where I should start digging to try<br>
&gt; and resolve this?<br>
<br>
</div></div>logged_in? is protected in the module AuthenticatedSystem. Chances are<br>
that you&#39;ve got a code example that&#39;s doing this:<br>
<br>
 &nbsp;controller.logged_in?<br>
<br>
instead of this:<br>
<br>
 &nbsp;controller.send(:logged_in?)<br>
<br>
and something that&#39;s not getting loaded when you run just<br>
sessions_controller_spec is including AuthenticatedSystem into the<br>
example group directly.<br>
<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Tim.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rspec-users mailing list<br>
&gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
&gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
&gt;<br>
_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br></div>