Pat Maddox
2007-May-21 06:31 UTC
[rspec-users] Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which looked like specify "should render abc123" do controller.should_render :text => "abc123" get :key end With 1.0.0, the new spec is it "should render abc123" do get :key response.should render_text("abc123") end However it doesn''t work, giving me the error: undefined method `render_text'' for #<#<Class:0x32ebdac>:0x381a454> I installed the 1.0.0 rails plugin, and ran script/generate rspec again. Any ideas as to what''s wrong? Pat
David Chelimsky
2007-May-21 08:31 UTC
[rspec-users] Just upgraded to 1.0.0, should render_text isn''t working for me
On 5/20/07, Pat Maddox <pergesu at gmail.com> wrote:> I finally got around to upgrading from 0.8.2 (!!). I had a spec which > looked like > > specify "should render abc123" do > controller.should_render :text => "abc123" > get :key > end > > With 1.0.0, the new spec is > > it "should render abc123" do > get :key > response.should render_text("abc123") > end > > However it doesn''t work, giving me the error: > undefined method `render_text'' for #<#<Class:0x32ebdac>:0x381a454>Try have_text instead of render_text. Cheers, David> > I installed the 1.0.0 rails plugin, and ran script/generate rspec > again. Any ideas as to what''s wrong? > > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Pat Maddox
2007-May-21 18:31 UTC
[rspec-users] Just upgraded to 1.0.0, should render_text isn''t working for me
On 5/21/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 5/20/07, Pat Maddox <pergesu at gmail.com> wrote: > > I finally got around to upgrading from 0.8.2 (!!). I had a spec which > > looked like > > > > specify "should render abc123" do > > controller.should_render :text => "abc123" > > get :key > > end > > > > With 1.0.0, the new spec is > > > > it "should render abc123" do > > get :key > > response.should render_text("abc123") > > end > > > > However it doesn''t work, giving me the error: > > undefined method `render_text'' for #<#<Class:0x32ebdac>:0x381a454> > > Try have_text instead of render_text.Alright, that worked. The docs at http://rspec.rubyforge.org/documentation/rails/writing/controllers.html reference render_text. It seems like a lot of the docs may be out of date...I''m unable to convert my helper specs at this point. http://rspec.rubyforge.org/documentation/rails/writing/helpers.html shows one example using helper_name and one without it. Unfortunately if I don''t use helper_name it says that my helper methods aren''t defined, but if I use helper_name then it turns out helper_name itself isn''t defined. If you could help me get these issues sorted out I''d be more than happy to update the docs accordingly. Pat
aslak hellesoy
2007-May-21 19:50 UTC
[rspec-users] Just upgraded to 1.0.0, should render_text isn''t working for me
On 5/21/07, Pat Maddox <pergesu at gmail.com> wrote:> On 5/21/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 5/20/07, Pat Maddox <pergesu at gmail.com> wrote: > > > I finally got around to upgrading from 0.8.2 (!!). I had a spec which > > > looked like > > > > > > specify "should render abc123" do > > > controller.should_render :text => "abc123" > > > get :key > > > end > > > > > > With 1.0.0, the new spec is > > > > > > it "should render abc123" do > > > get :key > > > response.should render_text("abc123") > > > end > > > > > > However it doesn''t work, giving me the error: > > > undefined method `render_text'' for #<#<Class:0x32ebdac>:0x381a454> > > > > Try have_text instead of render_text. > > Alright, that worked. The docs at > http://rspec.rubyforge.org/documentation/rails/writing/controllers.html > reference render_text. > > It seems like a lot of the docs may be out of date...I''m unable to > convert my helper specs at this point. > http://rspec.rubyforge.org/documentation/rails/writing/helpers.html > shows one example using helper_name and one without it. Unfortunately > if I don''t use helper_name it says that my helper methods aren''t > defined, but if I use helper_name then it turns out helper_name itself > isn''t defined. >Simply saying describe MyHelper should include the MyHelper module directly in the specs - provided you have put your specs under spec/helpers. Is this where you''re keeping them? And what OS are you on? Aslak> If you could help me get these issues sorted out I''d be more than > happy to update the docs accordingly. > > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Pat Maddox
2007-May-21 20:55 UTC
[rspec-users] Just upgraded to 1.0.0, should render_text isn''t working for me
On 5/21/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 5/21/07, Pat Maddox <pergesu at gmail.com> wrote: > > On 5/21/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 5/20/07, Pat Maddox <pergesu at gmail.com> wrote: > > > > I finally got around to upgrading from 0.8.2 (!!). I had a spec which > > > > looked like > > > > > > > > specify "should render abc123" do > > > > controller.should_render :text => "abc123" > > > > get :key > > > > end > > > > > > > > With 1.0.0, the new spec is > > > > > > > > it "should render abc123" do > > > > get :key > > > > response.should render_text("abc123") > > > > end > > > > > > > > However it doesn''t work, giving me the error: > > > > undefined method `render_text'' for #<#<Class:0x32ebdac>:0x381a454> > > > > > > Try have_text instead of render_text. > > > > Alright, that worked. The docs at > > http://rspec.rubyforge.org/documentation/rails/writing/controllers.html > > reference render_text. > > > > It seems like a lot of the docs may be out of date...I''m unable to > > convert my helper specs at this point. > > http://rspec.rubyforge.org/documentation/rails/writing/helpers.html > > shows one example using helper_name and one without it. Unfortunately > > if I don''t use helper_name it says that my helper methods aren''t > > defined, but if I use helper_name then it turns out helper_name itself > > isn''t defined. > > > > Simply saying describe MyHelper should include the MyHelper module > directly in the specs - provided you have put your specs under > spec/helpers. > > Is this where you''re keeping them? And what OS are you on? > > Aslak > > > If you could help me get these issues sorted out I''d be more than > > happy to update the docs accordingly. > > > > Pat > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >I was just running the specs with ruby... "ruby my_helper.rb", and it was having those problems. When I ran it with script/spec it ran fine. Pat