Am 14.03.2009 um 14:12 schrieb Zhenning Guan:

= flash_messages
- @user = User.find(1)

move that to the controller or a helper. always.
and if you try to find the admin with that, add a flag on the user
so you can write current_user.admin?


> - @forum.each do |f|
>   .group
>     = link_to f.name, forum_path(f)

Am I wrong or shouldn't that read:
- @forums.each do |f|

And do yourself a favour and write forum not f. Otherwise easily mistaken as a form.


does anyone have some good example?

About testing. Test with a current_user (e.g. template.should_receive(:current_user).and_return(User.find(2)),
with an admin and without any user at all.
And of course test with @forums being empty, a special response for that case would be nice.

ciao, tom

--
Thomas R. "TomK32" Koll || http://tomk32.de || http://ananasblau.com
just a geek trying to change the world
Skype: TomK32 || Mail: tom...@gmx.de
http://flickr.com/people/tomk32

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to