smparkes / capybara-envjs

Capybara driver for envjs gem
http://github.com/smparkes/capybara-envjs
130 stars 10 forks source link

Current url doesn't seem to be updated after a redirect #11

Closed mcmire closed 14 years ago

mcmire commented 14 years ago

I have a test that basically works like this:

visit "/foo"
click "some button"
# hits a URL, say, /bar, that redirects back to "/foo"
current_url.should =~ %r{/foo$}

When I inspect the body after clicking the button, I see the content of /foo. However, when I ask for the current_url, it tells me that it's still /bar. So it seems that envjs is honoring the redirect, but browser["window"].location.href is not being updated after the redirect, or maybe there's another way to access the new URL. Have you noticed this or do you have any ideas?

smparkes commented 14 years ago

I'll have to check ...

mcmire commented 14 years ago

Actually, I guess someone else at least has noticed it:

http://github.com/sikachu/capybara-envjs/commit/eeab07786dd89b651ef88db2f172afc5c98723fc

I can confirm that the fix works, so, there you go :)

smparkes commented 14 years ago

Cool. I do want to check and see if this should be fixed in env.js, too ....

smparkes commented 14 years ago

Fixed in capy-envjs 0.1.3 and envjs 0.3.5 (when they get pushed).

mcmire commented 14 years ago

Awesome, thanks!