-
Notifications
You must be signed in to change notification settings - Fork 557
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
Registered mock not responding #284
Comments
The failure is coming on a test that uses the poltergeist driver for Capybara. We might be looking at an issue with the interplay of these systems. |
You have to allow connections to localhost if you use Poltergeist, Selenium or any other driver that requires localhost server to be started. Add |
@emarthinsen, you still having this issue? What version of Ruby are you using? I was having a similar issue, I found removing the Whats weird is that it would pass fine with that field in Ruby 2.0.0, but fails in other versions (1.8.7, 1.9.2 and 1.9.2), it must be the way different versions of Ruby handle HTTP requests or something? |
@petems, I actually ended up changing my testing strategy to get around this issue. |
@petems Yes, different Ruby versions usually add different Accept-Encoding headers. The suggested signature generated by WebMock shows all headers, as it has no idea which of them are "not important". I usually get rid of Accept-Encoding from my stub declarations. |
I'm experiencing the same error even after removing the Accept-Encoding headers. You can see in the stack trace below that the first registered request stub is identical to the request stub suggested in the error message:
I'm using Poltergeist as my driver. Is anyone else still experiencing this problem? |
@ycha28 I just tried to reproduce the scenario you described, and it works fine:
You will need to provide a failing test/code. |
I was having a similar issue with the Capybara/Webdriver testing (via rspec). putting the below code inside of
|
Caveat, this could well be operator error.
Here's the error message I get when one of my tests fails:
Based upon the error message, it looks like my stubbed request should be working.
The exact snipped from error message above is in the "config.before :each" block of my rspec config in spec_helper.rb.
Any ideas what might be going on?
The text was updated successfully, but these errors were encountered: