Has the should_... syntax changed? I''m getting errors when running the following: should_render(:index) should_be_valid should_not_be_valid should_respond_to should_be should_render I thought the syntax changed to something like the following: obj.should render(:index) but this doesn''t seem to work. Scott
If I have rspec & rspec on rails checked out from trunk in my rails project, should I copy the spec & spec_server utilities into the script/ directory of my rails project (and run the generator) every time I run svn update? Scott On Apr 9, 2007, at 4:07 PM, Scott Taylor wrote:> > Has the should_... syntax changed? I''m getting errors when running > the following: > > should_render(:index) > should_be_valid > should_not_be_valid > should_respond_to > should_be > should_render > > I thought the syntax changed to something like the following: > > obj.should render(:index) > > but this doesn''t seem to work. > > Scott > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > Has the should_... syntax changed? I''m getting errors when running > the following: > > should_render(:index) > should_be_valid > should_not_be_valid > should_respond_to > should_be > should_render >Object now only gets monkeypatched with two methods: should and should_not. should_anything_else will no longer work.> I thought the syntax changed to something like the following: > > obj.should render(:index) >Syntactically, yes. But the API has changed too, so now you must say: response.should render_template(:index) See doc/output/rdoc-rails/index.html (rspec_on_rails/lib/spec/rails/matchers.rb RDoc) and example_rails_app/spec/controllers/people_controller_spec.rb for details. Aslak> but this doesn''t seem to work. > > Scott > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > If I have rspec & rspec on rails checked out from trunk in my rails > project, should I copy the spec & spec_server utilities into the > script/ directory of my rails project (and run the generator) every > time I run svn update? >To be safe, you should run "ruby script/generate rspec" after every svn update. However, you''ll be fine without running it unless there are changes to the rspec generator. Aslak> Scott > > > > On Apr 9, 2007, at 4:07 PM, Scott Taylor wrote: > > > > > Has the should_... syntax changed? I''m getting errors when running > > the following: > > > > should_render(:index) > > should_be_valid > > should_not_be_valid > > should_respond_to > > should_be > > should_render > > > > I thought the syntax changed to something like the following: > > > > obj.should render(:index) > > > > but this doesn''t seem to work. > > > > Scott > > > > > > _______________________________________________ > > 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 >
Thanks for the info, Aslak. What is the appropriate form of render in the view specs to use? Doing something like this: render "users/1/terms" gives me: /users/1/terms/index.html.erb I''m using restful-routes and markaby. I know there was a bug in the tracker about markaby templates. I''ll follow up on that if this is the case here. Scott On Apr 9, 2007, at 4:43 PM, aslak hellesoy wrote:> On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: >> >> Has the should_... syntax changed? I''m getting errors when running >> the following: >> >> should_render(:index) >> should_be_valid >> should_not_be_valid >> should_respond_to >> should_be >> should_render >> > > Object now only gets monkeypatched with two methods: should and > should_not. > should_anything_else will no longer work. > >> I thought the syntax changed to something like the following: >> >> obj.should render(:index) >> > > Syntactically, yes. But the API has changed too, so now you must say: > response.should render_template(:index) > > See doc/output/rdoc-rails/index.html > (rspec_on_rails/lib/spec/rails/matchers.rb RDoc) and > example_rails_app/spec/controllers/people_controller_spec.rb for > details. > > Aslak > >> but this doesn''t seem to work. >> >> Scott >> >> >> _______________________________________________ >> 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
On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > Thanks for the info, Aslak. > > What is the appropriate form of render in the view specs to use? >RSpec doesn''t have code without specs, so if you don''t find it in the docs, the best place to look is the specs> Doing something like this: > > render "users/1/terms" >That''s the right form.> gives me: >What do you mean by "gives me"?> /users/1/terms/index.html.erb >Seems to be a recent change in edge rails: http://dev.rubyonrails.org/changeset/6507> I''m using restful-routes and markaby. > > I know there was a bug in the tracker about markaby templates. I''ll > follow up on that if this is the case here. > > Scott > > > > On Apr 9, 2007, at 4:43 PM, aslak hellesoy wrote: > > > On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: > >> > >> Has the should_... syntax changed? I''m getting errors when running > >> the following: > >> > >> should_render(:index) > >> should_be_valid > >> should_not_be_valid > >> should_respond_to > >> should_be > >> should_render > >> > > > > Object now only gets monkeypatched with two methods: should and > > should_not. > > should_anything_else will no longer work. > > > >> I thought the syntax changed to something like the following: > >> > >> obj.should render(:index) > >> > > > > Syntactically, yes. But the API has changed too, so now you must say: > > response.should render_template(:index) > > > > See doc/output/rdoc-rails/index.html > > (rspec_on_rails/lib/spec/rails/matchers.rb RDoc) and > > example_rails_app/spec/controllers/people_controller_spec.rb for > > details. > > > > Aslak > > > >> but this doesn''t seem to work. > >> > >> Scott > >> > >> > >> _______________________________________________ > >> 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 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Forget this email. I figured it out. It works fine with markaby. As for nested routes, this works fine: render "/terms/index" Scott On Apr 9, 2007, at 5:36 PM, Scott Taylor wrote:> > Thanks for the info, Aslak. > > What is the appropriate form of render in the view specs to use? > > Doing something like this: > > render "users/1/terms" > > gives me: > > /users/1/terms/index.html.erb > > I''m using restful-routes and markaby. > > I know there was a bug in the tracker about markaby templates. I''ll > follow up on that if this is the case here. > > Scott > > > > On Apr 9, 2007, at 4:43 PM, aslak hellesoy wrote: > >> On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: >>> >>> Has the should_... syntax changed? I''m getting errors when running >>> the following: >>> >>> should_render(:index) >>> should_be_valid >>> should_not_be_valid >>> should_respond_to >>> should_be >>> should_render >>> >> >> Object now only gets monkeypatched with two methods: should and >> should_not. >> should_anything_else will no longer work. >> >>> I thought the syntax changed to something like the following: >>> >>> obj.should render(:index) >>> >> >> Syntactically, yes. But the API has changed too, so now you must say: >> response.should render_template(:index) >> >> See doc/output/rdoc-rails/index.html >> (rspec_on_rails/lib/spec/rails/matchers.rb RDoc) and >> example_rails_app/spec/controllers/people_controller_spec.rb for >> details. >> >> Aslak >> >>> but this doesn''t seem to work. >>> >>> Scott >>> >>> >>> _______________________________________________ >>> 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 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 4/9/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: > > > > Thanks for the info, Aslak. > > > > What is the appropriate form of render in the view specs to use? > > > > RSpec doesn''t have code without specs, so if you don''t find it in the > docs, the best place to look is the specs > > > Doing something like this: > > > > render "users/1/terms"Actually it''s not the right form. In view specs you want to specify the filesystem path to the template from the app/views directory. So if you want to describe app/views/users/index.erb, you would say: render ''users/index.erb'' We haven''t set out to support markaby specifically, so please report any related bugs in the tracker.> > > > That''s the right form. > > > gives me: > > > > What do you mean by "gives me"? > > > /users/1/terms/index.html.erb > > > > Seems to be a recent change in edge rails: > http://dev.rubyonrails.org/changeset/6507 > > > I''m using restful-routes and markaby. > > > > I know there was a bug in the tracker about markaby templates. I''ll > > follow up on that if this is the case here. > > > > Scott > > > > > > > > On Apr 9, 2007, at 4:43 PM, aslak hellesoy wrote: > > > > > On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: > > >> > > >> Has the should_... syntax changed? I''m getting errors when running > > >> the following: > > >> > > >> should_render(:index) > > >> should_be_valid > > >> should_not_be_valid > > >> should_respond_to > > >> should_be > > >> should_render > > >> > > > > > > Object now only gets monkeypatched with two methods: should and > > > should_not. > > > should_anything_else will no longer work. > > > > > >> I thought the syntax changed to something like the following: > > >> > > >> obj.should render(:index) > > >> > > > > > > Syntactically, yes. But the API has changed too, so now you must say: > > > response.should render_template(:index) > > > > > > See doc/output/rdoc-rails/index.html > > > (rspec_on_rails/lib/spec/rails/matchers.rb RDoc) and > > > example_rails_app/spec/controllers/people_controller_spec.rb for > > > details. > > > > > > Aslak > > > > > >> but this doesn''t seem to work. > > >> > > >> Scott > > >> > > >> > > >> _______________________________________________ > > >> 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 > > > > _______________________________________________ > > 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 >
On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > Forget this email. I figured it out. It works fine with markaby. > As for nested routes, this works fine: > > render "/terms/index"Glad you figured it out. I''m assuming that the template is app/views/terms/index.erb, right?> > Scott > > > On Apr 9, 2007, at 5:36 PM, Scott Taylor wrote: > > > > > Thanks for the info, Aslak. > > > > What is the appropriate form of render in the view specs to use? > > > > Doing something like this: > > > > render "users/1/terms" > > > > gives me: > > > > /users/1/terms/index.html.erb > > > > I''m using restful-routes and markaby. > > > > I know there was a bug in the tracker about markaby templates. I''ll > > follow up on that if this is the case here. > > > > Scott > > > > > > > > On Apr 9, 2007, at 4:43 PM, aslak hellesoy wrote: > > > >> On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: > >>> > >>> Has the should_... syntax changed? I''m getting errors when running > >>> the following: > >>> > >>> should_render(:index) > >>> should_be_valid > >>> should_not_be_valid > >>> should_respond_to > >>> should_be > >>> should_render > >>> > >> > >> Object now only gets monkeypatched with two methods: should and > >> should_not. > >> should_anything_else will no longer work. > >> > >>> I thought the syntax changed to something like the following: > >>> > >>> obj.should render(:index) > >>> > >> > >> Syntactically, yes. But the API has changed too, so now you must say: > >> response.should render_template(:index) > >> > >> See doc/output/rdoc-rails/index.html > >> (rspec_on_rails/lib/spec/rails/matchers.rb RDoc) and > >> example_rails_app/spec/controllers/people_controller_spec.rb for > >> details. > >> > >> Aslak > >> > >>> but this doesn''t seem to work. > >>> > >>> Scott > >>> > >>> > >>> _______________________________________________ > >>> 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 > > > > _______________________________________________ > > 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 >
On Apr 9, 2007, at 5:49 PM, David Chelimsky wrote:> On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: >> >> Forget this email. I figured it out. It works fine with markaby. >> As for nested routes, this works fine: >> >> render "/terms/index" > > Glad you figured it out. I''m assuming that the template is > app/views/terms/index.erb, right?.mab, since it''s markaby. Scott
On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > On Apr 9, 2007, at 5:49 PM, David Chelimsky wrote: > > > On 4/9/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: > >> > >> Forget this email. I figured it out. It works fine with markaby. > >> As for nested routes, this works fine: > >> > >> render "/terms/index" > > > > Glad you figured it out. I''m assuming that the template is > > app/views/terms/index.erb, right? > > .mab, since it''s markaby.Thanks!> > Scott > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >