In order to compare strings easily in our specs and to be compatible with Selenium, spaces should be normalized in text content.
When Selenium returns the text of a node, it locates the node using the @normalize-space@ XPath function. But Capybara-Webkit returns the raw text as it is represented on the page. This means specs that pass with Selenium may not pass in Capybara-Webkit, and it makes testing for the presence of strings harder.
We have worked around this issue with @gsub@s where necessary but ultimately Capybara-Webkit should return normalized strings for compatibility.
Here's our klidge if anyone is interested: textgoeshere/capybara-webkit@752ab7e
The issue is valid and the fix is correct. Has this been merged into main repo?
Strip and normalize spaces. Fixes #112 #145