mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Only expand the path if not already absolute
This commit is contained in:
parent
03052637e5
commit
482dfb35e3
2 changed files with 6 additions and 1 deletions
|
@ -300,7 +300,10 @@ private
|
|||
|
||||
def set_file(value) # rubocop:disable Naming/AccessorMethodName
|
||||
path_names = value.to_s.empty? ? [] : value
|
||||
native.send_keys(Array(path_names).map(&File.method(:expand_path)).join("\n"))
|
||||
file_names = Array(path_names).map do |pn|
|
||||
Pathname.new(pn).absolute? ? pn : File.expand_path(pn)
|
||||
end.join("\n")
|
||||
native.send_keys(file_names)
|
||||
end
|
||||
|
||||
def set_content_editable(value) # rubocop:disable Naming/AccessorMethodName
|
||||
|
|
|
@ -323,6 +323,8 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|||
end
|
||||
|
||||
it 'can attach a relative file' do
|
||||
pending 'Geckdoriver on windows requires alternate file separator which path expansion replaces' if Gem.win_platform? && firefox?(session)
|
||||
|
||||
session.visit('/form')
|
||||
session.attach_file('Single Document', 'spec/fixtures/capybara.csv')
|
||||
session.click_button('Upload Single')
|
||||
|
|
Loading…
Reference in a new issue