[rspec-users] extracting common methods out of specs

Scott Taylor mailing_lists at railsnewbie.com
Tue Mar 27 22:42:25 EDT 2007


I have several specs which do more or less the same thing:

describe "GET /users/1/terms" do
   controller_name :terms

   def do_get
     get :index, :user_id => 1
   end

   it "should be successful" do
     controller.should_render :index
     do_get
   end
   ...
end


How could I extract this functionality from each spec?

Scott



More information about the rspec-users mailing list