# Fragility of View Tests

**URL:** <https://www.ruby-forum.com/t/fragility-of-view-tests/105774>\
**Category:** Rails\
**Created:** [June 2, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/fragility-of-view-tests/105774 "2007-06-02T16:10:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmckible](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c4cdca/32.png) [@jmckible](https://www.ruby-forum.com/u/jmckible)\
**Post date:** [June 2, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/fragility-of-view-tests/105774/1 "2007-06-02T16:10:22Z")

</div>

I’ve always used the standard unit/functional/integration tests and  
found them satisfying. I recently started a new project with existing  
tests written using ZenTest. I was surprised to learn about the  
controller/view/helper tests it provides.

On one hand I understand the reasoning for breaking down functional  
tests into more specific concerns. It makes sense to test that a  
controller is controlling properly and that a view is rendering  
properly.

However in practice I’m worried that a view test would be far too  
fragile. What exactly can you test? That a form shows up or that a  
specific h1 tag is present? Given how quickly agile code changes, is it  
really worthwhile to test views to that degree? If a view renders with  
an error, you would still see that fault in a well constructed  
functional test.

I also don’t like the fact that you need to assign variables before  
rendering the view. Not only does it seem clunky and redundant, you’re  
liable to miss a problem that stems from the controller. To really  
capture the interaction between a controller and a view, you’d end up  
needing to do some integration/functional test anyway.

Is anyone else using view tests? What do you think of them? I’m  
interested to know if you’re doing TDD and if you’re working on design  
at the same time.

Jordan  
[http://jordan.mckible.com](http://jordan.mckible.com)
