Hi!

I'm running into issue which seems to indicate that 
ActionController::TestCase.get() method ignores what I have in routes.rb.
Happens in 3.0.10 and 3.1.0 too.

I have the following RSpec2 test of my XmlRpcController#index action:

it "should get nothing in response to GET request" do
  get :index
  response.response_code.should == 400 #bad_request
end

And the only line related to this route in routes.rb is:

post 'rpc', :to => "xml_rpc#index"

'rake routes' also shows only this route defined.

As a result when I run this test that action actually DOES get executed! I 
judge this by putting a simple puts inside it) and also a log contains:

"Processing by XmlRpcController#index as HTML"

Also if I go to 'localhost:3000/rpc' in browser - it says "no route found": 
just like it should. But tests have other behavior and this puzzles me...

Can anybody hint my why does this happen? I'm only starting learning about 
RoR :) Earlier it seemed to me that these 'get/post' methods of TestCase do 
respect routes.rb...

Am I missing something obvious? :)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/cRsGGIEtj5kJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to