Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Bug when visiting a page with params that contains square brackets #558

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

When I visit a page with square brackets in the params of the url like /foo?bar[baz]=true
Then I should see that page

Instead, the request is never sent.

Traced this as far as lib/capybara/webkit/browser.rb:145 in the command method.

Run with the following:

rspec spec/integration/session_spec.rb --tag wip

found this with @coffeencoke

Helena Converse + Matt Simpson Add spec to expose but when visiting a page with params that contains…
… a square bracket in it.
b243049
Collaborator

mhoran commented Aug 14, 2013

@n3rdgir1, I believe #422 fixes this issue. However, it seems that the Qt 4 vs Qt 5 behavior is different in this case, see the failing builds here: https://travis-ci.org/mhoran/capybara-webkit/builds/10181074.

I applied #422 to master but I was not able to get a passing test.

Here is my test
https://github.com/jspooner/capybara-webkit/commits/master

Here is my QT info

brew info qt
qt: stable 4.8.5 (bottled), HEAD
http://qt-project.org/
/usr/local/Cellar/qt/4.8.5 (2777 files, 119M) *
  Poured from bottle
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/qt.rb
==> Dependencies
Optional: d-bus, mysql
==> Options
--developer
    Build and link with developer options
--universal
    Build a universal binary
--with-d-bus
    Build with d-bus support
--with-docs
    Build documentation
--with-mysql
    Build with mysql support
--with-qt3support
    Build with deprecated Qt3Support module support
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

I monkey patched the visit method until this gets resolved.

#
# Quick patch until this gets fixed
# https://github.com/thoughtbot/capybara-webkit/pull/558
#
module Capybara::Webkit
  class Driver
    def visit(path)
      browser.visit(path.gsub("[","\%5B").gsub("]","\%5D"))
    end
  end
end
Collaborator

mhoran commented Nov 10, 2013

#422 has been merged to master. Please give it a shot and let us know if there are any issues.

@mhoran mhoran closed this Nov 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment