Closed leequarella closed 12 years ago
I think you're trying to call a post
method from your test -- there is no such method in Capybara (apart from an internal Rack-Test method). Use the visit
method instead. See the README at https://github.com/jnicklas/capybara, section The DSL, for more info.
By the way, the mailing list is a better place for questions like this -- this issue tracker is meant for reproducible bugs with Capybara.
Hi Guys I have a strange issue with 'remote: true' links on my side I use link_to to send post request on view:
= link_to 'Toggle', toggle_moderator_user_path(user), method: :patch, remote: true
In config/routes.rb I have:
resources :users do
member do
patch :toggle_moderator
end
end
this my test
describe 'toggle moderator' do
it 'remove moderator privilegue', js: true do
click("Toggle")
end
end
And then I see fail in log
ActionController::RoutingError:
No route matches [GET] "/users/9/toggle_moderator"
Seems, that on click to link to it always sends GET Thanks for any help)
Completely flubbered on this one... not finding references to this error. Capybara is working just fine with my rpsec setup, but when setting the :js => true option on a test, this error occurs:
Maybe my brain just borked, but I don't even know where to start :-(