lib/capybara/spec/session/selectors_spec.rb in capybara-2.8.1 vs lib/capybara/spec/session/selectors_spec.rb in capybara-2.9.0
- old
+ new
@@ -43,7 +43,19 @@
end
it "can find specifically by placeholder" do
expect(@session.find(:field, placeholder: 'FirstName')['id']).to eq "form_first_name"
end
+
+ it "can find by type" do
+ expect(@session.find(:field, 'Confusion', type: 'checkbox')['id']).to eq 'confusion_checkbox'
+ expect(@session.find(:field, 'Confusion', type: 'text')['id']).to eq 'confusion_text'
+ expect(@session.find(:field, 'Confusion', type: 'textarea')['id']).to eq 'confusion_textarea'
+ end
+
+ it "can find by class" do
+ expect(@session.find(:field, class: 'confusion-checkbox')['id']).to eq 'confusion_checkbox'
+ expect(@session).to have_selector(:field, class: 'confusion', count: 3)
+ expect(@session.find(:field, class: ['confusion','confusion-textarea'])['id']).to eq 'confusion_textarea'
+ end
end
end
\ No newline at end of file