Closed misner closed 6 years ago
Not being sure it's the right place, as the line between a core bug and me failing as a dev:) is blurry here, I'll also post a Stackoverflow: https://stackoverflow.com/questions/48419015/rails-4-2-failing-to-stub-delayed-response-for-image-with-puffing-billy-imag
Looking at the Connection to
log messages, it's not finding your stubbed request. I'm assuming it's because it's looking for :443
after the domain whereas your stub doesn't have that.
@ronwsmith Thanks for your reply. That's what I thought too but trying to add :443 but my test keep failing. However my logs changed and now I don't have the same log message anymore
puffing-billy: Connection to https://res.cloudinary.com:443/demo/image/upload/sample.jpg not cached and new http connections are disabled
I am investigating now but it most likely shows it's a bug outside puffing billy or loosely connected. Indeed, I still pass my tests as soon as I remove billy: true, that is to say I am able to see the image after the spinner when there is no billy: true.
Hi, really appreciated the time you took to help me forward. I tracked down the bug in the "rabbit hole":) and I am opening a new issue as I now have closed down on a clear issue (different from this one), but which is pretty insane to me: https://github.com/oesmith/puffing-billy/issues/215
This ticket can be closed I think.
I have rspec tests and I feel there is a bug with puffing billy or maybe I am misunderstanding the use of whitelists in the settings.
Basically the test is about checking that, if a third party hosted image (on a service called Cloudinary) takes time to be downloaded by a page, then the user sees a loading spinner and after the image is finally loaded the spinner disappears and is not visible anymore.
I'm sure billy is the root cause as
if I don't use puffing billy (by removing billy: true) to stub/fake a 10 seconds response delay for the third party image, as you might guess, I see the image (using save_and_open_page to make sure) too soon and my test can't be implemented.
if I use billy by using billy: true, then the image NEVER appears (checked it by save_and_open_page) and the spinner keeps turning as the actual stubbed image never shows up , it's like it was "blocked" by puffing billy... also making the test not doable :(
Puffing billy settings
The rspec test:
)
The image in the view
I have tried different variations on the settings, tried also to change https//res.cloudinary to res.cloudinary.com...nothing works
Finally, I think it matters, I keep seeing in my tests logs:
On these Test logs, first I don't quite understand why there are so many lines for the same resource and second, what does this message mean "not cached and new http connections are disabled". I tried other tickets with similar sounding issues such as https://github.com/oesmith/puffing-billy/issues/104 or https://github.com/oesmith/puffing-billy/issues/179 or, but my bug might be original...