How to select date from a select box using Capybara in Rails 3?

后端 未结 11 1513
梦如初夏
梦如初夏 2020-12-05 10:27

I\'m writing a spec for a controller in Rails 3 project using RSpec and Capybara, and I want to select current date from a select box. I tried:

select Date.t         


        
11条回答
  •  误落风尘
    2020-12-05 11:09

    Thanks to Dylan for pointing it out, but in case anyone is looking for the cucumber version, you can use this:

    select_date("Date of birth", :with => "1/1/2011")
    

    For more information, see select_date.

提交回复
热议问题