没有路由匹配rspec中的错误

时间:2013-11-22 11:27:05

标签: ruby-on-rails rspec routes

我的

describe PaymentController do

 it 'should assign amount_to_pay' do

  get bank_payment_path, {id: "1"}

  expect(assigns[:amount_to_pay]).to eq "123"
 end
end

我的错误:

Error: ActionController::RoutingError: No route matches {:action=>"bank", :controller=>"payment"}

和rake路线:

  bank_payment GET    /payment/:id/bank(.:format)             payment#bank

那里有什么问题?

1 个答案:

答案 0 :(得分:0)

请求应为:

get :bank, id: "1"