[rspec-devel] [ rspec-Feature Requests-6098 ] Make scaffold_resource generator

noreply at rubyforge.org noreply at rubyforge.org
Mon Nov 27 21:48:47 EST 2006


Feature Requests item #6098, was opened at 2006-10-11 10:01
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6098&group_id=797

Category: rails plugin
Group: None
Status: Open
Priority: 3
Submitted By: Aslak Hellesøy (aslak_hellesoy)
Assigned to: Aslak Hellesøy (aslak_hellesoy)
Summary: Make scaffold_resource generator

Initial Comment:
In the new RESTful Rails it's better to use the scaffold_resource generator. We should support it too.

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

>Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-28 02:48

Message:
This is in the trunk now (as of rev 1160) but I'm not closing this because it's not yet tested in an automated way.

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-26 20:18

Message:
Luckliy I happened to have a copy of the code locally before the svn disappeared. I have attached it.

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

Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-25 01:30

Message:
Hey Pat - I went to http://svn.flpr.org/public/plugins/rspec_resource_generator to grab the latest source and couldn't get to it (can't even ping  flpr.org). Would you mind posting a new link to it, or just attaching a patch to this ticket?

I'd like to get this in soon.

Thanks,
David

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-09 16:54

Message:
I think the routing patch should be applied separately in spec/rails. We have to make it work with both 1.1.6 and Edge Rails.

This brings up another issue - our build system needs to be able to run all spec/rails specs several times, typically once for the latest Rails release and once for edge. -Possibly with a mechanism to differentiate what's being run depending on the Rails version.

I think the most pragmatic way to verify that this (and other generators) is working is to have the rake script (bootstrap_rspec.rake) execute the various generators before specs are run. And then delete the generated files afterwards (or maybe right before they're generated).

This would require that we change the templates - right now they fail on purpose with "not enough specs". We should be able to generate stuff and have all specs pass.

If you could help with any of this it would be fabulous!

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

Comment By: Pat Maddox (pergesu)
Date: 2006-11-09 16:35

Message:
I applied the patch.

Sorry about the routing method error...I completely forgot I had that in there.  I saw your comment in http://rubyforge.org/tracker/?func=detail&atid=3151&aid=6471&group_id=797 that it doesn't work in 1.1.6.  What would you like me to do for this plugin?  Should I move the routing method into the plugin itself?

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-09 14:17

Message:
I'm attaching a patch with some small improvements: should_eql and correct use of controller_class_name

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-09 13:41

Message:
Looks like routing is defined in this "patch": http://rubyforge.org/tracker/index.php?func=detail&aid=6471&group_id=797&atid=3152

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-09 13:34

Message:
I tried this with RSpec's demo app (vendor/rspec_on_rails) - I created an account resource. The following code is failing:

NoMethodError in 'The accountsController should map { :controller => 'accounts', :action => 'show', :id => 1 } to /accounts/1'
undefined method `routing' for #<#<Class:0x2b7260c>:0x3b2d680>

Where is this routing method defined?

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

Comment By: Pat Maddox (pergesu)
Date: 2006-11-04 16:49

Message:
My plugin at http://svn.flpr.org/public/plugins/rspec_resource_generator/ handles that.  I removed the forked code, so the only template now is the controller_spec.  Everything else is pulled from the standard Rails generators, and the rspec_model generator for the model spec.

Anything else that should be done with that?

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-04 09:28

Message:
We should *not* fork/copy Rails code. Reuse all the existing templates, swap the test generation with spec generation (our own template). See the implementation of rspec_model and rspec_controller generators.

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

Comment By: Jeff Dean (jefdean)
Date: 2006-10-30 08:09

Message:
I've written an rspec_scaffold_resource generator and I'm just waiting to here back on a few questions about directory changes in trunk before submitting the patch - Jeff Dean

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

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


More information about the rspec-devel mailing list