ruby on rails - Using RSpec, how to verify from tags and link tags in view pages? -
in view pages, people use form tag helpers , link helpers etc.
if rename controller, or action, view pages may break.
how can unit test view related tags kind of breakage?
so term "unit test" reserved tests test 1 piece of application @ time-- test 1 view , test independently of associated controller , model.
but have found, if isolate tests, can break interaction between 2 , still have unit tests passing.
that's why it's important have tests exercise whole application working together. these called functional, integration, or acceptance tests (i don't find useful distinguish between these terms ymmv).
this done using browser simulator capybara or webrat using application how user in browser. demand different techniques unit tests do, don't end brittle tests or tests take long time run without providing additional value time spent.
you can use various test frameworks drive capybara, including rspec. many people use rspec unit tests , use cucumber integration tests. highly recommend the rspec book, covers cucumber , different methods of testing , when should use them.
Comments
Post a Comment