From c6b275c955e9972ecace5ddbf2595ad63f8d0788 Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Fri, 26 Feb 2016 11:33:32 -0800 Subject: [PATCH 1/3] Add documention for Capybara::Node::Actions#attach_file options hash --- lib/capybara/node/actions.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/capybara/node/actions.rb b/lib/capybara/node/actions.rb index 21c0b5fa..12bbcf70 100644 --- a/lib/capybara/node/actions.rb +++ b/lib/capybara/node/actions.rb @@ -150,6 +150,11 @@ module Capybara # @param [String] locator Which field to attach the file to # @param [String] path The path of the file that will be attached, or an array of paths # + # @option options [Symbol] match The matching strategy to use (:one, :first, :prefer_exact, :smart) + # @option options [Boolean] exact Match the exact locator name or accept a partial match + # @option options [Fixnum] wait If using a Javascript driver, number of seconds during which the element will be searched for. + # @option options [Boolean] multiple Match field which allows multiple file selection + # def attach_file(locator, path, options={}) Array(path).each do |p| raise Capybara::FileNotFound, "cannot attach file, #{p} does not exist" unless File.exist?(p.to_s) From d8a344fe36c9c844b2cd253d00af9201f03ff666 Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Sat, 27 Feb 2016 14:28:42 -0800 Subject: [PATCH 2/3] Update wording and add default values to attach_file docs [ci skip] --- lib/capybara/node/actions.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/capybara/node/actions.rb b/lib/capybara/node/actions.rb index 12bbcf70..c8a52df3 100644 --- a/lib/capybara/node/actions.rb +++ b/lib/capybara/node/actions.rb @@ -150,10 +150,10 @@ module Capybara # @param [String] locator Which field to attach the file to # @param [String] path The path of the file that will be attached, or an array of paths # - # @option options [Symbol] match The matching strategy to use (:one, :first, :prefer_exact, :smart) - # @option options [Boolean] exact Match the exact locator name or accept a partial match - # @option options [Fixnum] wait If using a Javascript driver, number of seconds during which the element will be searched for. - # @option options [Boolean] multiple Match field which allows multiple file selection + # @option options [Symbol] match (:smart) The matching strategy to use (:one, :first, :prefer_exact, :smart). + # @option options [Boolean] exact (true) Match the exact label name/contents or accept a partial match. + # @option options [Fixnum] wait (Capybara.default_max_wait_time) If using a Javascript driver, maximum number of seconds during which the element will be searched for. + # @option options [Boolean] multiple (true) Match field which allows multiple file selection # def attach_file(locator, path, options={}) Array(path).each do |p| From 86425a51257a585f3c3e9d8a6a2814efe167feda Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Sun, 28 Feb 2016 22:38:32 -0800 Subject: [PATCH 3/3] Fix default values on attach_file docs --- lib/capybara/node/actions.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/capybara/node/actions.rb b/lib/capybara/node/actions.rb index c8a52df3..6312df4c 100644 --- a/lib/capybara/node/actions.rb +++ b/lib/capybara/node/actions.rb @@ -150,10 +150,10 @@ module Capybara # @param [String] locator Which field to attach the file to # @param [String] path The path of the file that will be attached, or an array of paths # - # @option options [Symbol] match (:smart) The matching strategy to use (:one, :first, :prefer_exact, :smart). - # @option options [Boolean] exact (true) Match the exact label name/contents or accept a partial match. + # @option options [Symbol] match (Capybara.match) The matching strategy to use (:one, :first, :prefer_exact, :smart). + # @option options [Boolean] exact (Capybara.exact) Match the exact label name/contents or accept a partial match. # @option options [Fixnum] wait (Capybara.default_max_wait_time) If using a Javascript driver, maximum number of seconds during which the element will be searched for. - # @option options [Boolean] multiple (true) Match field which allows multiple file selection + # @option options [Boolean] multiple Match field which allows multiple file selection # def attach_file(locator, path, options={}) Array(path).each do |p|