Shaum Sona wrote:
> How do we test application controller and application helper in rails?
Two answers.
The best answer is you should use Test-Driven Development, where you write a
test that fails because a minor ability of a feature is not there, and you get
the test to fail for the correct reason. Then you write a little code to provide
the ability and pass the test.
The great thing about TDD is you are not required to make sure the test actually
calls the exact method that provides the ability. Sometimes that''s a
good goal,
yet TDD provides such comprehensive test coverage that the ideal of
"unit"
testing becomes less important.
You TDD the application controller and helper by firing up the usual functional
tests on your usual controllers and views, and TDDing their features.
The second answer: El Goog would have lead you to "rails helper
tests":
http://nubyonrails.com/articles/test-your-helpers
The third answer is I don''t see why a functional test cannot simply
reach out to
ApplicationController alone...
--
Phlip
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---