# Testing issue with creating a view/layout

**URL:** <https://www.ruby-forum.com/t/testing-issue-with-creating-a-view-layout/173052>\
**Category:** Rails\
**Created:** [August 1, 2009, 1:37am UTC](https://www.ruby-forum.com/t/testing-issue-with-creating-a-view-layout/173052 "2009-08-01T01:37:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [August 1, 2009, 1:37am UTC](https://www.ruby-forum.com/t/testing-issue-with-creating-a-view-layout/173052/1 "2009-08-01T01:37:55Z")

</div>

Bad subject line, but not sure what would be better.

My issue only seems to happen in testing and I want to see if I can  
find a way to fix it.  
My rails app will host many domains each with its own layout. (stored  
as layouts/sites/ID.html.haml)  
This layout is generated when the site instance is created. When  
testing, rails does not pick up the fact that there is a new layout  
available.

Example using cucumber…

Given there is a site known as “site1”  
When I am on the press releases page

The layout is generated and save in the first step. The 2nd step a  
simple webrat visit doesn’t see the new layout. Even if I premake the  
layout before running the feature, the webrat step does not see the  
updates.

Is there anyway around this? How does one force rails to “refresh” the  
views/layouts?

Rails normally checks on each “hit”, but it seems the webrat hits are  
different, like all in one session.

Many thanks…

-timw
