I'm writing some rspec tests and I notice that it slows down when accessing my Mailer class. Is there a way to mock out the ActionMailer::Base class completely so I can test other components of my controller before and after the email delivery?
Here is my mailer class definition
class OrganisationMailer < ActionMailer::Base
# code to send emails
end
Here is one of the tests I've written
require 'spec_helper'
describe OrganisationsController do
describe "#email_single" do
context "With email address" do
let(:org) {Organisation.make!}
it "redirects to listing" do
get :email_single, :id => org.id
response.should redirect_to(organisations_path)
end
end
end
end