2
I created a project creation system with image. My images are uploaded to Cloudinary + Carrierwave.
Before the Test did not break because I sent to the server, but when I integrated in Cloudinary the code broke.
I think I know what it can be, but I don’t know how to fix it. When it inserts it into the Cloudinary database it returns a random value, as I do to
**within(".asset_project") do
expect(page).to have_css("img[src*='project.png']")
end**
the TDD is correct, because I think this is it.
Follows the image of errors and code:
if it puts a random value, you cannot access the model and compare if the one in the view is the same as the model’s?
– Felipe Bergamo
If I understand the question, you need to "mock" a call to an external API. Is that? If yes, using the Gem Webmock does not solve?
– Rodrigo
solved to Gem! Thank you very much!
– Rodolfo Peixoto