lib/capybara/spec/session/find_field_spec.rb in capybara-2.5.0 vs lib/capybara/spec/session/find_field_spec.rb in capybara-2.6.0
- old
+ new
@@ -19,11 +19,11 @@
end.to raise_error(Capybara::ElementNotFound)
end
it "should warn if filter option is invalid" do
expect_any_instance_of(Kernel).to receive(:warn).
- with('Invalid value nil passed to filter disabled')
+ with('Invalid value nil passed to filter disabled - defaulting to false')
@session.find_field('Dog', disabled: nil)
end
it "should be aliased as 'field_labeled' for webrat compatibility" do
expect(@session.field_labeled('Dog').value).to eq('dog')
@@ -57,9 +57,17 @@
it "should not find disabled fields by default" do
expect do
@session.find_field("Disabled Checkbox")
end.to raise_error(Capybara::ElementNotFound)
+ end
+
+ it "should find disabled fields when :all" do
+ expect(@session.find_field("Disabled Checkbox", :disabled => :all)[:name]).to eq("form[disabled_checkbox]")
+ end
+
+ it "should find enabled fields when :all" do
+ expect(@session.find_field('Dog', :disabled => :all).value).to eq('dog')
end
end
context 'with :readonly option' do