我有这个,当我用瑞克路由时
admin_pdf_templates GET /admin/pdf_templates(.:format) {:controller=>"admin/pdf_templates",:action=>"show"} PUT /admin/pdf_templates(.:format){:controller=>“管理员/pdf_模板”,:action=>"update"} DELETE /admin/pdf_template(.:format){:controller=>“管理员/pdf_模板”,pdf“destroy”} POST /admin/:action=>_templates(.:format){:controller=>“管理员/pdf_模板”,:action=>“创建”}
在黄瓜paths.rb中创建动作的路径是什么。
我的paths.rb是when /create pdf/ admin_pdf_templates_path(id:=> @user.id)
上面的路径调用GET方法。如何在cucumber中调用paths.rb中的POST方法。
发布于 2012-09-29 08:03:40
您需要描述用户为了发出post请求而必须执行的步骤,而不是显式地发出请求。
例如。
Given I am on the new item form
When I fill out the form
Then I should see the new item. 然后,您将定义When步骤
fill_in 'Name' :with => 'My Name'
click_button 'Submit'点击是触发帖子的原因。
如果没有接口来测试这种交互,那么您可能不应该使用cucumber。
如果你坚持在没有用户触发的情况下发出post请求,这个主题看起来很相似。
https://stackoverflow.com/questions/12648398
复制相似问题