Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Capybara cucumber/webrat:如何测试提交按钮是否未禁用_Capybara_Webrat - Fatal编程技术网

Capybara cucumber/webrat:如何测试提交按钮是否未禁用

Capybara cucumber/webrat:如何测试提交按钮是否未禁用,capybara,webrat,Capybara,Webrat,刚开始用黄瓜和网鼠。我有以下功能步骤: When /^I choose a DVD$/ do #just click the first one we see check("optional-dvds[]") end Then /^I should be able to place my order$/ do #the place my order button should be clickable end 有问题的按钮包含以下html: <input disabled=

刚开始用黄瓜和网鼠。我有以下功能步骤:

When /^I choose a DVD$/ do
  #just click the first one we see
  check("optional-dvds[]")
end

Then /^I should be able to place my order$/ do
  #the place my order button should be clickable
end
有问题的按钮包含以下html:

<input disabled="disabled" id="submit_button" name="commit" type="submit" value="Please send this DVD">
或者类似的东西。我知道这是jquery和rspec的可怕混搭(顺便说一句:)

试试这个

page.should have_no_xpath "//input[@id='submit_button' and @disabled]"
还是这个

page.should have_no_selector "#submit_button", :disabled => 'disabled'
page.should have_no_selector "#submit_button", :disabled => 'disabled'