On May 23, 2011, at 5:54 PM, itsterry wrote:

> Still can't find an answer on this one by Googling or tweaking
> 
> Any thoughts appreciated...

The following works for me:

#####################################
# spec/shared/thing.html.erb_spec.rb 

require 'spec_helper'

describe 'shared/_thing.html.erb' do
  it 'renders' do
    render
    rendered.should =~ /Hello/
  end
end

# app/views/shared/_thing.html.erb
Hello
#####################################

HTH,
David

> On May 19, 11:09 am, itsterry <itste...@gmail.com> wrote:
>> Hi all
>> 
>> Would very much appreciate any assistance with this. Have Googled it
>> but can't find an answer to it.
>> 
>> I'm using Rails3/Rspec2
>> 
>> I'm spec'ing a view which is a partial called 'shared/_panels'.
>> 
>> When I try to spec it, I get an error that the controller 'shared'
>> cannot be found (there isn't a controller called 'shared', just a
>> shared folder which holds partials which are used in a couple of
>> different places).
>> 
>> I've tried changing the 'render' line to (various riffs on)
>> render :partial=>'shared/panels'
>> 
>> ...but I'm not having any joy
>> 
>> Any ideas anyone?
>> 
>> TIA!
>> 
>> Terry
>> _______________________________________________
>> rspec-users mailing list
>> rspec-us...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Cheers,
David



_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to