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

Local javascript : Connection refused - connect(2) #30

Open
chrisharper opened this issue Aug 19, 2010 · 8 comments
Open

Local javascript : Connection refused - connect(2) #30

chrisharper opened this issue Aug 19, 2010 · 8 comments

Comments

@chrisharper
Copy link

Currently moving over from selenium to envjs and liking the massive speed increase so far.

I have noticed however I get the following error when running tests:

WARNIING:   [Thu Aug 19 2010 14:49:02 GMT+0100 (BST)] {ENVJS} could not load script http://subdomaina.example.com:9887/javascripts/rails.js?1281952643: Connection refused - connect(2)

The javascript is however working fine as a checkbox toggle hides and shows a div and I find not issues in the logs.

It should probably be noted I'm using http://github.com/thoughtbot/capybara-envjs-fixes as I was unable to get the tests to even run without it, not sure which may be causing the issue.

@chrisharper
Copy link
Author

Little bit more digging and it seems Rails 3 unobtrusive delete functionality is broken

link_to 'Delete' , user, :method => :delete 

As defined in /public/rails.js , I should also mention i got an error about application.js like the above but this is being loaded fine.

The plot thickens :)

@smparkes
Copy link
Owner

Is this the delete thing a separate issue? If so, can you create a separate issue?

As to the connection refused, does capy support subdomains? I can never remember the answer to this ...

@chrisharper
Copy link
Author

From what i could tell the two issues are related, I'll do some further investigation in the morning to see whats happening . Capybara does support subdomains by changing Capybara.app_host and Capybara.default_host for each subdomain you want.

@smparkes
Copy link
Owner

As to the host stuff, right, and capy-envjs should follow that. Is it not?

I thought the issue might be trying to wildcard the domain in some way, so that more than one host was fed to your app, and I'm not sure if capy handles that.

@chrisharper
Copy link
Author

I've create some tests on a repo ( http://github.com/charper/envjs-test ) so you can see what Im encountering. subdomain.feature demonstrate the above issue. test.feature contain other items i've came across during investigating this issue this morning.

@smparkes
Copy link
Owner

Okay.

I think the "could not load" is because you are not setting default_host and app_host. Did it now work when you tired that. (I'm not sure it's been tested/works with ports?)

The HIDDEN stuff is because, I think, envjs isn't handling CSS styles well enough.

The delete stuff is just painful. The event code is pretty crufty. I'm afraid it doesn't handle bubbling correctly and live() requires it.

@chrisharper
Copy link
Author

Tried changing both default_host and app_host with no difference in result. Does seem strange that it doesnt load the JS when its on a subdomain given it can connect and run through steps fine.

The hidden div seems to be a issue with Capybara itself as this also fails within webdriver. I should of checked this before posting here. I had forgotten that I wrote the test after switching to envjs.

Ill have a look again on Monday to try and solve the connect and delete issue as I can't describe enough how much I want to move from webdriver and i could never get culerity to work correctly.

@smparkes
Copy link
Owner

The default_host/app_host stuff should be fixable, as long as you're not trying to change it on the fly and/or use more than one host. Is that right? (It might be fixable anyway, but I'm not sure where there might be assumptions about things not changing).

I remember making something with hidden work to make the capy tests run, but I don't remember the details. I do know that in general the CSS stuff is very incomplete, so if that's a big part of what you want to do, there are likely to be issues.

The delete stuff ... well, it's fixable with time, but I'm not sure where that time is going to come from on my part. That code really needs to be cleaned. It may be possible to pull the code from the master env.js branch, until we can get the Johnson fork merged (which has no current eta; everybody busy ...)

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