I like model tests, they make sense to me. But I still haven''t quite
''got'' functional testing. I''m having difficulty
doing sensible
testing... I quite often end up calling the same method in my tests
as I do in my ''real'' code, which to me feels very wrong, and
seems
likely to be hiding more bugs than it shows.
For example, I want to display a file size in a view. So I compare
the response body against the regexp /File size : #{human_size
(File.size(file))}/
What do I then paste into my view code? Almost exactly the same
thing : File size : <%= human_size(File.size(@asset.file)) %>
Does anyone else think there''s something wrong there? It feels a bit
icky to be making my tests pass by essentially cut & pasting from my
test code...
Would love to see other people''s functional tests to get a better
idea of what should & shouldn''t be tested. Anyone willing to
share?
Jon
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---