sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
301 stars 65 forks source link

Request out to google fonts for Ubuntu font necessary when using Webmock. #13

Closed skunkworker closed 6 years ago

skunkworker commented 7 years ago

I ran into this issue when running tests that would send emails. I'm using webmock to stub out the requests and it seems like mjml pulls in the Ubuntu font from google fonts api. After spending some time on a strange error inside of premailer-rails I figured out what mjml-rails needed to get it working. The following gist has a webmock response. https://gist.github.com/skunkworker/c7d4cc065bdeaafa71307f18652f00c4

Is there an easier way to disable this for tests?

sighmon commented 7 years ago

@skunkworker Sorry, I don't have any experience with webmock. Might VCR do what you want?

skunkworker commented 7 years ago

I got it working by stubbing out the request to use the ubuntu font. Is that a forced part of mjml?

sighmon commented 7 years ago

@skunkworker looks like it is. But there are workarounds.