Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visit method not working with external url #20

Open
bikashp opened this issue Jul 6, 2010 · 4 comments
Open

visit method not working with external url #20

bikashp opened this issue Jul 6, 2010 · 4 comments

Comments

@bikashp
Copy link

bikashp commented Jul 6, 2010

Simple test using visit method seems to fail while using envjs driver. Works fine with default driver.

When I google
Then I should see "2010 Google"

When /^I google$/ do
visit "http://www.google.com" \n
end

Running feature fails with "false is not true. (Test::Unit::AssertionFailedError)" message.

Also when using full url (eg. http://www.google.com/webhp), it errors out with "No route matches "/webhp" with {:method=>:get} (ActionController::RoutingError)" message

@smparkes
Copy link
Owner

smparkes commented Jul 6, 2010

Can you push a repo I can try?

Do you get any envjs error when you do this? Google has enough messy JS on their page that it breaks envjs. At one point I tried to track down the cause, but it's all minifed stuff which which is just painful to deal with.

@bikashp
Copy link
Author

bikashp commented Jul 7, 2010

I made simple changes to http://github.com/schlick/capybara-demo to test visit method on external link using envjs. Changes i made are already posted on issue.

Error/failure message:
false is not true. (Test::Unit::AssertionFailedError)
/usr/local/lib/ruby/1.8/test/unit/assertions.rb:48:in assert_block' /usr/local/lib/ruby/1.8/test/unit/assertions.rb:500:inwrap_assertion'
/usr/local/lib/ruby/1.8/test/unit/assertions.rb:46:in assert_block' /usr/local/lib/ruby/1.8/test/unit/assertions.rb:63:inassert'
/usr/local/lib/ruby/1.8/test/unit/assertions.rb:495:in _wrap_assertion' /usr/local/lib/ruby/1.8/test/unit/assertions.rb:61:inassert'
./features/step_definitions/web_steps.rb:104
./features/step_definitions/web_steps.rb:13:in with_scope' ./features/step_definitions/web_steps.rb:100:in/^(?:|I )should see "([^\"]
)"(?: within
"([^\"]_)")?$/'

There is envjs warning message also:
{ENVJS} could not load script http://www.google.com/javascripts/jquery-1.4.2.min.js?1276247318:
XML tag name mismatch (expected meta)

I think it is still assuming that link as local rails app link and trying to load jquery and application
js file. If i change url to http://www.google.com/webhp, it gives "No route matches "/webhp" with {:method=>:get} (ActionController::RoutingError)" message.

@smparkes
Copy link
Owner

smparkes commented Jul 7, 2010

Cool. This is should be able to make some sense of. As long as it's not tortured JS ...

@smparkes
Copy link
Owner

Is this still an issue? If so, can you tell me how to replicate it? I did the normal rake test and cucumber tasks and they succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants