Test ActionMailer deliver_later in RSpec Controller Tests

Testing emails

Deliver now

it "sends email notification" do
      NotificationMailer.admin_new_update_mail(admin.id, update.id).deliver_now

      expect(ActionMailer::Base.deliveries.count).to eq(1)

      mail = ActionMailer::Base.deliveries.last
      expect(mail.to).to eq([admin.email])
      expect(mail.subject).to eq('New update created on Teamitup')
    end