# Rspec, HAML, view testing

**URL:** <https://www.ruby-forum.com/t/rspec-haml-view-testing/149455>\
**Category:** Rails\
**Created:** [September 25, 2008, 12:38am UTC](https://www.ruby-forum.com/t/rspec-haml-view-testing/149455 "2008-09-25T00:38:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![regealey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/49beb7/32.png) [@regealey](https://www.ruby-forum.com/u/regealey)\
**Post date:** [September 25, 2008, 12:38am UTC](https://www.ruby-forum.com/t/rspec-haml-view-testing/149455/1 "2008-09-25T00:38:49Z")

</div>

Hi all,

Has anybody experience the following problem running testing rspec  
against haml views

Attempting to run a view spec

app/view/users/\_foo.html.haml

it “should render it” do  
render :partial =\> “users/foo”, :locals =\> template\_locals  
end

1. 

ActionView::MissingTemplate in ‘shared/\_jar\_layout should render it’  
Missing templatet users/\_foo.html.erb in view path …  
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action\_view/template.rb:85:in  
`raise\_missing\_template\_exception’

I have tried stubbing the template via  
@template.stub!(:find\_template\_extension\_for).and\_return(“haml”) # same  
error return

Thanks in advance,
