diff --git a/lib/capybara/node/finders.rb b/lib/capybara/node/finders.rb index 8570576a..e2e5c061 100644 --- a/lib/capybara/node/finders.rb +++ b/lib/capybara/node/finders.rb @@ -153,6 +153,7 @@ module Capybara result end end + alias_method :find_all, :all ## # diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb index ec01468f..c5765342 100644 --- a/lib/capybara/session.rb +++ b/lib/capybara/session.rb @@ -27,7 +27,7 @@ module Capybara NODE_METHODS = [ :all, :first, :attach_file, :text, :check, :choose, :click_link_or_button, :click_button, :click_link, :field_labeled, - :fill_in, :find, :find_button, :find_by_id, :find_field, :find_link, + :fill_in, :find, :find_all, :find_button, :find_by_id, :find_field, :find_link, :has_content?, :has_text?, :has_css?, :has_no_content?, :has_no_text?, :has_no_css?, :has_no_xpath?, :resolve, :has_xpath?, :select, :uncheck, :has_link?, :has_no_link?, :has_button?, :has_no_button?, :has_field?, diff --git a/lib/capybara/spec/session/all_spec.rb b/lib/capybara/spec/session/all_spec.rb index 7c9ceb7d..532b39ab 100644 --- a/lib/capybara/spec/session/all_spec.rb +++ b/lib/capybara/spec/session/all_spec.rb @@ -149,4 +149,9 @@ Capybara::SpecHelper.spec "#all" do end end end + + it "should have #find_all as an alias" do + expect(Capybara::Node::Finders.instance_method(:all)).to eq Capybara::Node::Finders.instance_method(:find_all) + expect(@session.find_all('//p').size).to eq(3) + end end