Skip to content

Commit

Permalink
Merge pull request #1509 from jnicklas/find_all
Browse files Browse the repository at this point in the history
add #find_all as an alias of #all - Issue #1396
  • Loading branch information
twalpole committed Jul 16, 2015
2 parents bc47af0 + ae1e4cb commit dedd871
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/capybara/node/finders.rb
Expand Up @@ -153,6 +153,7 @@ def all(*args)
result
end
end
alias_method :find_all, :all

##
#
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/session.rb
Expand Up @@ -27,7 +27,7 @@ class Session
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?,
Expand Down
5 changes: 5 additions & 0 deletions lib/capybara/spec/session/all_spec.rb
Expand Up @@ -149,4 +149,9 @@
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

0 comments on commit dedd871

Please sign in to comment.