Jim Morris
2010-Dec-22 08:51 UTC
[rspec-users] running rspec in spec/requests directory with cells fails
Hi, not exactly sure if this is a cells bug or an rspec (or both), but when running a simple request spec from the spec/requests directory gets an error whereas running it from the RAILS ROOT directory it works.. Seems it cannot find the view in the cells directory. The full project is in https://github.com/wolfmanjm/wolfmanblog_rails. Using rails 3.0.3 and rspec-rails 2.2.1> cd spec/request > rspec basics_spec.rb[sequel] Setting up the "test" environment: F Failures: 1) Basic tests works! (now write some real specs) Failure/Error: visit "/" Missing template cell/rails/google_search with {:locale=>[:en, :en], :handlers=>[:haml, :rjs, :rhtml, :rxml, :erb, :builder], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json]} in view paths "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ app/cells", "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ app/cells/layouts" and possible paths sidebar/google_searchcell/rails/ google_search # /home/morris/work/ruby/rails3/wolfmanblog/app/cells/ sidebar_cell.rb:8:in `google_search'' # /home/morris/work/ruby/rails3/wolfmanblog/app/helpers/ application_helper.rb:3:in `sidebar'' # /home/morris/work/ruby/rails3/wolfmanblog/app/views/layouts/ application.html.haml:34:in `_app_views_layouts_application_html_haml__882586219_84745880_0'' # ./basics_spec.rb:5 Finished in 0.14442 seconds 1 example, 1 failure
David Chelimsky
2010-Dec-22 13:52 UTC
[rspec-users] running rspec in spec/requests directory with cells fails
On Dec 22, 2010, at 2:51 AM, Jim Morris wrote:> Hi, not exactly sure if this is a cells bug or an rspec (or both), but > when running a simple request spec > from the spec/requests directory gets an error whereas running it from > the RAILS ROOT directory it works.. > Seems it cannot find the view in the cells directory. > > The full project is in https://github.com/wolfmanjm/wolfmanblog_rails. > Using rails 3.0.3 and rspec-rails 2.2.1 > >> cd spec/requestTry running from the project root instead: $ rspec spec/requests/basics_spec.rb or $ rspec spec/requests or $ rake spec:requests HTH, David>> rspec basics_spec.rb > > [sequel] Setting up the "test" environment: > F > > Failures: > > 1) Basic tests works! (now write some real specs) > Failure/Error: visit "/" > Missing template cell/rails/google_search with > {:locale=>[:en, :en], :handlers=>[:haml, :rjs, :rhtml, :rxml, :erb, :builder], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json]} > in view paths "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ > app/cells", "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ > app/cells/layouts" and possible paths sidebar/google_searchcell/rails/ > google_search > # /home/morris/work/ruby/rails3/wolfmanblog/app/cells/ > sidebar_cell.rb:8:in `google_search'' > # /home/morris/work/ruby/rails3/wolfmanblog/app/helpers/ > application_helper.rb:3:in `sidebar'' > # /home/morris/work/ruby/rails3/wolfmanblog/app/views/layouts/ > application.html.haml:34:in > `_app_views_layouts_application_html_haml__882586219_84745880_0'' > # ./basics_spec.rb:5 > > Finished in 0.14442 seconds > 1 example, 1 failure > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersCheers, David
Jim Morris
2010-Dec-22 19:44 UTC
[rspec-users] running rspec in spec/requests directory with cells fails
Yes it works from ROOT as I said in original post :) However I can run normal request specs from the request directory itself, if they don''t use cells. Is rspec meant to only run from ROOT? Also this part of the error message seems suspicious... and possible paths sidebar/google_searchcell/rails/google_search Seems to have concatenated two paths into one. The reason I am asking is because the rspec-mode for emacs runs its specs from the directory the spec you are testing resides. I''ll need to fix that if rspec is not meant to be run from there. Thanks On Dec 22, 5:52?am, David Chelimsky <dchelim... at gmail.com> wrote:> On Dec 22, 2010, at 2:51 AM, Jim Morris wrote: > > > Hi, not exactly sure if this is a cells bug or an rspec (or both), but > > when running a simple request spec > > from the spec/requests directory gets an error whereas running it from > > the RAILS ROOT directory it works.. > > Seems it cannot find the view in the cells directory. > > > The full project is inhttps://github.com/wolfmanjm/wolfmanblog_rails. > > Using rails 3.0.3 and rspec-rails 2.2.1 > > >> cd spec/request > > Try running from the project root instead: > > $ rspec spec/requests/basics_spec.rb > > or > > $ rspec spec/requests > > or > > $ rake spec:requests > > HTH, > David > > > > >> rspec basics_spec.rb > > > [sequel] Setting up the "test" environment: > > F > > > Failures: > > > ?1) Basic tests works! (now write some real specs) > > ? ? Failure/Error: visit "/" > > ? ? Missing template cell/rails/google_search with > > {:locale=>[:en, :en], :handlers=>[:haml, :rjs, :rhtml, :rxml, :erb, :builder], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json]} > > in view paths "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ > > app/cells", "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ > > app/cells/layouts" and possible paths sidebar/google_searchcell/rails/ > > google_search > > ? ? # /home/morris/work/ruby/rails3/wolfmanblog/app/cells/ > > sidebar_cell.rb:8:in `google_search'' > > ? ? # /home/morris/work/ruby/rails3/wolfmanblog/app/helpers/ > > application_helper.rb:3:in `sidebar'' > > ? ? # /home/morris/work/ruby/rails3/wolfmanblog/app/views/layouts/ > > application.html.haml:34:in > > `_app_views_layouts_application_html_haml__882586219_84745880_0'' > > ? ? # ./basics_spec.rb:5 > > > Finished in 0.14442 seconds > > 1 example, 1 failure > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > Cheers, > David > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky
2010-Dec-22 20:09 UTC
[rspec-users] running rspec in spec/requests directory with cells fails
On Dec 22, 2010, at 1:44 PM, Jim Morris wrote:> Yes it works from ROOT as I said in original post :)Oops. Missed that.> However I can run normal request specs from the request directory > itself, if they don''t use cells. > > Is rspec meant to only run from ROOT?Yes. You _can_ get it to work elsewhere, but you have to do some fun things w/ the LOAD_PATH to do it.> Also this part of the error message seems suspicious... > > and possible paths sidebar/google_searchcell/rails/google_search > > Seems to have concatenated two paths into one. > > The reason I am asking is because the rspec-mode for emacs runs its > specs from the directory the spec you are testing resides. > I''ll need to fix that if rspec is not meant to be run from there.Yeah, that''s the case. Cheers, David> > Thanks > > > On Dec 22, 5:52 am, David Chelimsky <dchelim... at gmail.com> wrote: >> On Dec 22, 2010, at 2:51 AM, Jim Morris wrote: >> >>> Hi, not exactly sure if this is a cells bug or an rspec (or both), but >>> when running a simple request spec >>> from the spec/requests directory gets an error whereas running it from >>> the RAILS ROOT directory it works.. >>> Seems it cannot find the view in the cells directory. >> >>> The full project is inhttps://github.com/wolfmanjm/wolfmanblog_rails. >>> Using rails 3.0.3 and rspec-rails 2.2.1 >> >>>> cd spec/request >> >> Try running from the project root instead: >> >> $ rspec spec/requests/basics_spec.rb >> >> or >> >> $ rspec spec/requests >> >> or >> >> $ rake spec:requests >> >> HTH, >> David >> >> >> >>>> rspec basics_spec.rb >> >>> [sequel] Setting up the "test" environment: >>> F >> >>> Failures: >> >>> 1) Basic tests works! (now write some real specs) >>> Failure/Error: visit "/" >>> Missing template cell/rails/google_search with >>> {:locale=>[:en, :en], :handlers=>[:haml, :rjs, :rhtml, :rxml, :erb, :builder], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json]} >>> in view paths "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ >>> app/cells", "/home/morris/work/ruby/rails3/wolfmanblog/spec/requests/ >>> app/cells/layouts" and possible paths sidebar/google_searchcell/rails/ >>> google_search >>> # /home/morris/work/ruby/rails3/wolfmanblog/app/cells/ >>> sidebar_cell.rb:8:in `google_search'' >>> # /home/morris/work/ruby/rails3/wolfmanblog/app/helpers/ >>> application_helper.rb:3:in `sidebar'' >>> # /home/morris/work/ruby/rails3/wolfmanblog/app/views/layouts/ >>> application.html.haml:34:in >>> `_app_views_layouts_application_html_haml__882586219_84745880_0'' >>> # ./basics_spec.rb:5 >> >>> Finished in 0.14442 seconds >>> 1 example, 1 failure >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-us... at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> Cheers, >> David >> >> _______________________________________________ >> 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-users