Capybara has current_url, which returns an url that is unmatcheable since it includes a randomized port, and current_path with contains neither query nor fragment(aka hash/anchor) and is therefore rather useless.
Behold the perfect current_path_info, which returns the full path and query + fragment.
Code
def current_path_info
current_url.sub(%r{.*?://},'')[%r{[/\?\#].*}] || '/'
end