[rspec-users] [rspec] How to pass route parameters to post method?

Evgeny Bogdanov evgeny.bogdanov at gmail.com
Tue Jun 2 03:50:25 EDT 2009


I am trying to spec an action in a controller, and rspec doesn't find
a route.
It seems that problem is in ":viewtype". If I change a line
into "/context/asset/add" in routes it works.

I tried also
post "/context/asset/add", no luck.

Could you please let me know how I can call the action through
that route with post method?

Thank you in advance,
  map.with_options(:controller => "assets", :conditions =>{:method
=> :post}) do |m|
    m.create_asset                   '/:viewtype/asset/
add',                        :action => 'create'

describe AssetsController, "when working with formats" do
  it "should call a find_asset_format for some actions" do
    post :create

More information about the rspec-users mailing list