Code Monkey home page Code Monkey logo

Comments (3)

renz45 avatar renz45 commented on August 11, 2024

Hi Pat,

I would probably just test that the mandrill_mail method is receiving the correct args (mocks/stubs). This gem has tests that test if the Mandrill gem is receiving arguments from the mandrill_mail method, so there is no sense in re-testing that again. You should just assume that if you give mandrill_mail the correct arguments they'll get to where they need to go.

If you realllllllyyy want to go that far you can look at https://github.com/renz45/mandrill_mailer/blob/master/lib/mandrill_mailer/template_mailer.rb#L192. This gem is really just a wrapper for the actual mandrill gem, it adds a few things that makes it easier to use. You could just stub/mock Mandrill::Messages to test that the correct attributes are getting passed to the send_template method.

I still wouldn't test the actual request being made (with something like VCR), at that point you're doubling up on tests from the Mandrill gem.

from mandrill_mailer.

pat avatar pat commented on August 11, 2024

Hi Adam

Thanks for the feedback - though, I've no desire to stub things out, given they're acceptance-level tests (I certainly stub out the mailer for unit tests). I may investigate adapting the mandrill gem to have a test mode that stores requests but doesn't send them through (much like ActionMailer::Base.deliveries).

from mandrill_mailer.

renz45 avatar renz45 commented on August 11, 2024

Closing since this was merged ;)

from mandrill_mailer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.