On Mon, Jun 2, 2008 at 11:23 PM, Jose Fernandez <[EMAIL PROTECTED]> wrote: > Pat Maddox wrote: >> On Mon, Jun 2, 2008 at 11:16 PM, Jose Fernandez <[EMAIL PROTECTED]> >> wrote: >>> So how can I test a mocked rails controller within my plugin's specs? >> >> I don't quite follow you. Can you post an example of what you're trying >> to do? >> >> Pat > > http://github.com/jfernandez/submarine/tree/b3853cb0a959813f156bb25239dcd4f4f2c0c406/spec/submarine/submarine_spec.rb > > That only test wont work because neither the 'controller_name' or 'get' > methods are recognized, and I think thats because they are part of > rspec-rails.
You need to include the app's spec-helper from within your spec. http://github.com/pat-maddox/rspec-plugin-generator/tree/master/generators/rspec_plugin/templates/spec_helper.rb shows what I did in my rspec_plugin generator. You might just be able to require spec/rails, I'm not sure, but you'd have to set up the load path. Pat _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
