Fischer, Daniel
2007-Jun-01 02:06 UTC
[rspec-users] Okay, new question - dealing w/ logging in restrictions (controller?)
Hey all, so if you read my previous thing about nested routes - I''m
just not going to do with them anymore.
Anyway, so my controller has a before_filter on the edit action; which
checks to see if the current post''s user, is the same as the currently
logged in user, if true then they can edit, otherwise not.
def check_user
if current_user.login != @post.user.login
redirect_to post_url(@post)
end
end
Now I can easily test this functionality by seeing if I get redirected
if I hit that page, but what if I actually want to be logged in, so I
can test to see if the edit action is working?
Any input on this?
Thanks.
--
-Daniel Fischer
http://danielfischer.com - Geek Blog
http://abigfisch.com - Portfolio
http://writersbeat.com - Writing Community
