mirror of
https://github.com/teampoltergeist/poltergeist.git
synced 2022-11-09 12:05:00 -05:00
stringify non-string paths to avoid Rails' .to_json implementation on Pathname objects
This commit is contained in:
parent
af6a1bccd8
commit
36cc2bb792
2 changed files with 9 additions and 1 deletions
|
@ -104,7 +104,7 @@ module Capybara::Poltergeist
|
|||
end
|
||||
|
||||
def render(path, options = {})
|
||||
command 'render', path, !!options[:full]
|
||||
command 'render', path.to_s, !!options[:full]
|
||||
end
|
||||
|
||||
def resize(width, height)
|
||||
|
|
|
@ -95,6 +95,14 @@ module Capybara::Poltergeist
|
|||
end
|
||||
end
|
||||
|
||||
it 'supports rendering the page with a nonstring path' do
|
||||
file = POLTERGEIST_ROOT + '/spec/tmp/screenshot.png'
|
||||
FileUtils.rm_f file
|
||||
@driver.visit('/')
|
||||
@driver.render(Pathname(file))
|
||||
File.exist?(file).should == true
|
||||
end
|
||||
|
||||
it 'supports executing multiple lines of javascript' do
|
||||
@driver.execute_script <<-JS
|
||||
var a = 1
|
||||
|
|
Loading…
Add table
Reference in a new issue