# Testing controller without integrate views

**URL:** <https://www.ruby-forum.com/t/testing-controller-without-integrate-views/133034>\
**Category:** RSpec\
**Created:** [March 26, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/testing-controller-without-integrate-views/133034 "2008-03-26T22:29:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahrel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df705f/32.png) [@jahrel](https://www.ruby-forum.com/u/jahrel)\
**Post date:** [March 26, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/testing-controller-without-integrate-views/133034/1 "2008-03-26T22:29:56Z")

</div>

Hello,

I’m new to RSpec and I’m having some trouble testing controllers.  
After a lot of testing without coming any closer to a solution, I  
figured I should try describing the problem here. Any help will be  
appreciated. 🙂

I’m testing controllers and view separately, but something strange  
seems to be happening. When I omit integrate\_views, all controllers  
return a 200 OK status even if the view doesn’t actually exist. That’s  
seems to be OK because even so RSpec seems to be using some internal  
information and find the correct status.

But, for some reason, some actions are not following this pattern. The  
status is incorrect even if the template doesn’t exist. That’s messing  
with the tests, because things like response.should be\_success and  
response.render\_template(“controller/template”). So, if I implement  
the test to expect a failure, it doesn’t actual fail and I’m unsure  
about the tests now.

And if I use integrate\_views, the tests fail correctly with the right  
status code.

Has anybody seem anything like that? What are the best practices when  
not using integrate\_views?

Thanks for all the help,

Ronaldo
