0

位置情報リソースがあり、次の方法でアクセスできます。

http://localhost:3000/locations/37/edit

私の仕様では、次のものがあります。

it "should allows us to edit" do
  @u=User.find_by_email('jon@domain.com')
  session[:user_id]=@u.id    
  get edit_location_path, {:id => '37'}

しかし、次のエラーが発生します。

Failures:

  1) LocationsController should allows us to edit
     Failure/Error: get edit_location_path, :id => '37'
     ActionController::RoutingError:
       No route matches {:action=>"edit", :controller=>"locations"}
     # ./spec/controllers/locations_controller_spec.rb:12:in `block (2 levels) in <top (required)>'

このリソースへのリンクを指定するにはどうすればよいですか?

どうも

4

2 に答える 2

2

を記述したコントローラー仕様だとするとLocationsController、 でアクセスできますget :edit, :id => 37

于 2012-08-28T03:41:23.770 に答える
1

ただやりますget edit_location_path(37)か??

于 2012-08-28T04:50:42.407 に答える