Last Updated: February 25, 2016
·
626
· joshsmoore

ovoid duplicated emails with email_spec gem

When you are using emailspec with cucumber make sure that delivermethod is set before requiring the gem (see below). If you require the gem fist then change the deliver_method to :test it will record the emails twice.

ActionMailer::Base.delivery_method = :test

 require 'email_spec'
 require 'email_spec/cucumber'