mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Call to_s on expression passed to CSS::split - Issue #2093
This commit is contained in:
parent
e1161bd4e3
commit
edc8a25f0b
2 changed files with 8 additions and 1 deletions
|
@ -30,7 +30,7 @@ module Capybara
|
|||
class Splitter
|
||||
def split(css)
|
||||
selectors = []
|
||||
StringIO.open(css) do |str|
|
||||
StringIO.open(css.to_s) do |str|
|
||||
selector = ''
|
||||
while (char = str.getc)
|
||||
case char
|
||||
|
|
|
@ -10,6 +10,13 @@ Capybara::SpecHelper.spec '#has_css?' do
|
|||
expect(@session).to have_css('p a#foo')
|
||||
end
|
||||
|
||||
it 'should take a symbol as the selector' do
|
||||
# This was never a specifically accepted format but it has worked for a
|
||||
# lot of versions. Probably should keep it until at least 4.0
|
||||
# TODO: consider not supporting symbol for the CSS selector.
|
||||
expect(@session).to have_css(:p)
|
||||
end
|
||||
|
||||
it 'should be false if the given selector is not on the page' do
|
||||
expect(@session).not_to have_css('abbr')
|
||||
expect(@session).not_to have_css('p a#doesnotexist')
|
||||
|
|
Loading…
Add table
Reference in a new issue