Phil

2011/3/30 Andre Schütz <[email protected]>

> Hello,
>
> I added the "before_filter" to my controllers to require a login of the
> user.
>
> Here's an example of my Unit Controller with the added before_filter:
>
> IN THE ATTACHED FILE
>
> When executing the tests with rake test, I get different error messages.
>
> To show you my errors, I only executed the unit controller test with the
> following line:
> ruby -Itest test/functional/units_controller_test.rb
>
> I get the folowing errors:
>
> IN THE ATTACHED FILE
>
> If I delete the "before_filter :login_required" line from the unit
> controller, the test will be executed without any errors.
>
> I have a controller_authentication.rb file within my /lib directory. The
> content of the file:
>
> IN THE ATTACHED FILE
>
> Can I use one of the methods to get access for the tests?
>
> I tried to find a solution for that problem, but I could not find any
> during the last two days.
> Please give me advice to solve that problem.
>

You'll need to create a user and make sure they are logged in, within any of
your tests that require the user to be logged in. How you do this depends on
you're authenticating your users...


>
> Thanks in advance,
> Andre
>
> Attachments:
> http://www.ruby-forum.com/attachment/6092/controller_and_error.txt
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to