itsterry
2011-May-19 10:09 UTC
[rspec-users] How to spec Rails view partials in shared folders
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
itsterry
2011-May-23 22:54 UTC
[rspec-users] How to spec Rails view partials in shared folders
Still can''t find an answer on this one by Googling or tweaking Any thoughts appreciated... On May 19, 11:09?am, itsterry <itste... at 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... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky
2011-May-24 00:20 UTC
[rspec-users] How to spec Rails view partials in shared folders
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... at 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... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersCheers, David