Hi,
I use restful routes. In one of my views I have a form that looks like:
<%- form_tag '/items/update', :method => :put do -%>
...
<%= submit_tag "Recalculate" %>
<%- end -%>
I know I cheated a bit, as I should be submitting to /items/1 instead.
Anyway, now how can I trigger the update action in my controller test?
I tried stuff like:
post :update, {:method => 'put', :item => {'1' => {:quantity => 5}}}
But the route recognition isn't pleased, I guess it's missing an :id. Is
it possible to test the way I coded it?
PS: please no comment about writing code before testing, I know it's a
bad habit, and I am doing my best to change it.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users