<div dir="ltr">Hi David,<br><br>You were spot on. The generated authenticated_system_spec included AuthenticatedSystem. If I include AuthenticatedSystem into the SessionsController spec, then the specs all pass. This is a problem with the standard specs that resful_authentication builds for you - so I'll looking at getting those fixed..<br>
<br>I'm kind of curios that the specs are testing these protected methods - I would have expected that's generally not a done thing as they're not a public part of the API?<br><br>I guess there's 3 options as to how to patch:<br>
1) include AuthenticatedSystem, or<br> 2) change the specs to use .send, or<br> 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"><<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>></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 <<a href="mailto:tmhaines@gmail.com">tmhaines@gmail.com</a>> wrote:<br>
> Hi there,<br>
><br>
> I've noticed something a little odd with the session_controller specs that<br>
> are generated from the rails plugin restful_authentication. When they're<br>
> run with all the other app specs (i.e. when I first fire up autospec) the<br>
> specs all pass. However, if I touch the session_controller_spec file so<br>
> only the session_controller specs are run, some fail with the error message<br>
> protected method `logged_in?' called for #<SessionsController:0x19100e0><br>
><br>
> Can anyone explain why this might be or where I should start digging to try<br>
> and resolve this?<br>
<br>
</div></div>logged_in? is protected in the module AuthenticatedSystem. Chances are<br>
that you've got a code example that's doing this:<br>
<br>
controller.logged_in?<br>
<br>
instead of this:<br>
<br>
controller.send(:logged_in?)<br>
<br>
and something that's not getting loaded when you run just<br>
sessions_controller_spec is including AuthenticatedSystem into the<br>
example group directly.<br>
<br>
><br>
> Cheers,<br>
><br>
> Tim.<br>
><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>
><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>