Mike Schiller
2008-Jun-12 06:40 UTC
[rspec-users] Which "get" is being used in Controller spec
Hi, I''m a bit puzzled with "get" in controller specs. When I write, it "should render index template" do get :index response.should render_template(:index) end Which "get" method is being used? I checked RDoc of RSpec and RSpec on Rails, but didn''t find "get". In Rails RDoc, I found the following "get"s. get ActionController::Integration::Session get ActiveResource::Connection get ActiveResource::CustomMethods get ActiveResource::CustomMethods::InstanceMethods I''m not sure which one is working. But after playing a while, I noticed "get" doesn''t take "path" as a parameter. For example, get "users" doesn''t work. I also need to know about "post" because some code I saw seems to be passing parameters like: post :create :id => 1 Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080612/03510ff0/attachment.html>
Matthias Hennemeyer
2008-Jun-12 09:03 UTC
[rspec-users] Which "get" is being used in Controller spec
Hi Mike, the request methods used in Controller tests are defined in Rails: ActionController::TestProcess. Rspec Rails Stories are basically Rails Integration tests and the methods used here are defined in Rails: ActionController::Integration::Session. Matthias Am 12.06.2008 um 08:40 schrieb Mike Schiller:> Hi, > > I''m a bit puzzled with "get" in controller specs. When I write, > > it "should render index template" do > get :index > response.should render_template(:index) > end > > > Which "get" method is being used? I checked RDoc of RSpec and RSpec > on Rails, but didn''t find "get". > In Rails RDoc, I found the following "get"s. > > get ActionController::Integration::Session > get ActiveResource::Connection > get ActiveResource::CustomMethods > get ActiveResource::CustomMethods::InstanceMethods > > I''m not sure which one is working. But after playing a while, I > noticed "get" doesn''t take "path" as a parameter. For example, > > get "users" > > doesn''t work. I also need to know about "post" because some code I > saw seems to be passing > parameters like: > > post :create :id => 1 > > Mike > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users