[rspec-devel] [ rspec-Bugs-11891 ] script/generate rspec_controller fails to create appropriate views (from templates) on edge rails

noreply at rubyforge.org noreply at rubyforge.org
Wed Jun 27 15:45:08 EDT 2007


Bugs item #11891, was opened at 2007-06-27 15:45
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: George Anderson (caton)
Assigned to: Nobody (None)
Summary: script/generate rspec_controller fails to create appropriate views (from templates) on edge rails

Initial Comment:
Mac OSX 10.4.9
edge rails: r7126
rspec (plugin): r2082
rspec_on_rails: r2081

Views couldn't be generated by script/generate rspec_controller ...

 $ script/generate rspec_controller patient_base index face_sheet patient_messages rx chart_timeline archive chart_note flow_sheet hist
ory hospital lab_results radiology x_ray
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/patient_base
      exists  spec/controllers/
      exists  spec/helpers/
      create  spec/views/patient_base
      create  spec/controllers/patient_base_controller_spec.rb
      create  spec/helpers/patient_base_helper_spec.rb
      create  app/controllers/patient_base_controller.rb
      create  app/helpers/patient_base_helper.rb
      create  spec/views/patient_base/index_view_spec.rb
      create  app/views/patient_base/index.rhtml
No such file or directory - /Users/george/work/one_box/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml


railties/lib/rails_generator/generators/components/controller/templates/view.html changed to view.html.erb as of r6690 (roughly 2 months ago).  
See:  http://dev.rubyonrails.org/browser/trunk/railties/lib/rails_generator/generators/components/controller/templates

Rails 1.2 STABLE should use view.rhtml (See: http://dev.rubyonrails.org/browser/branches/1-2-stable/railties/lib/rails_generator/generators/components/controller/templates)

So perhaps this ticket is premature.  Consider, however, the *.html.erb style will eventually be in the STABLE release.  At that time, RSpec may have to deal with the *old* and *new* style templates.

For those of you reading this far, and not feeling you have suffient RSpec-fu to create a patch for this (myself included among you), consider this workaround:

$ script/generate rspec_controller patient_base index

this will throw the error herein described, but just lop off the "rspec_" bit and run:

$ script/generate controller patient_base index

Most of the files will be identical, but the *.html.erb-style templates will generate as expected.

For bonus points, clean up the test::unit cruft thusly:

$ rm test/functional/patient_base_controller_test.rb

Thx.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11891&group_id=797


More information about the rspec-devel mailing list