Ruby-水豚-ArgumentError:无效的密钥

时间:2019-03-26 14:45:32

标签: ruby rspec capybara

我正在执行一个代码,在其中验证输入是否已禁用,但是发生错误。

CODE

before(:each) do
    visit 'https://training-wheels-protocol.herokuapp.com/dynamic_controls'
end

it 'quando habilita o campo' do
    res = page.has_field? 'movie', disable: true
    puts res
end 

错误

 ArgumentError:
   invalid keys :disable, should be one of :count, :minimum, :maximum, :between, :text, :id, :class, :style, :visible, :exact, :exact_text, :normalize_ws, :match, :wait, :filter_set, :checked, :unchecked, :disabled, :multiple, :readonly, :with, :type, :name, :placeholder
 # ./spec/dynamic_control_spec.rb:8:in `block (2 levels) in <top (required)>'

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

错误消息告诉您哪些有效的选项可以传递给has_field?。您应该传递disabled: true而不是:disable。