I am in the process of upgrading from Rails 3 to 4. Whenever I run a
test I always get two errors like this:
Capybara::Rails::TestCase#test_printer_url:
ActionController::UrlGenerationError: No route matches
{:action=>"test",
:controller=>"printers"} missing required keys: [:id]
If I test all my controllers I get 2, if I just test one of my models I
get the same 2. They are nothing to do with any test I have written
myself, they seem to be tests Capybara is running on itself.
The problem seems to arise because I have a route for printers in my
project, set up like this.
resources :printers do
member do
get :test
end
end
Okay, so just rename it to something to stop the name collision... If I
rename "test" to "test_printer45745dc", or I change it from
GET to POST
it still fails! And if I have a second member line in there, I get four
errors.
If I change it to a collection, I get a different error:
Capybara::Rails::TestCase#test_printers_url:
ArgumentError: Missing host to link to! Please provide the :host
parameter, set default_url_options[:host], or set :only_path to true
What Capybara seems to do is to generate tests on the fly, based on the
routes, and then generate errors however they are set up.
Why would it do that? What can I do about it?
I am using JRuby 1.7.4 on Windows, by the way
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/a7f21d55f1780c3118904ae5005dc480%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.