Ruby on Rails Wednesday, March 30, 2011

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.

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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment