Sha256: 308bd01eca883c7aec4ddf831db82d442420ce586e5a29d2516f9de8a8ed4258
Contents?: true
Size: 1.21 KB
Versions: 35
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' describe SendEmailTo do let(:session) { Sessions::BasicAuthSession.new } before { allow(Sessions::BasicAuthSession).to receive(:new).and_return session } it 'performs a post on the emails api path providing the person_id and the email attributes' do email_attributes = {subject: 'some_subject', body: 'some_body', bcc: 'some@bcc', content_type: 'some/content/type', mail_type: 'some_mail_type'} expect(session).to receive(:post).with '/emails', person_id: 'some_person_id', email: email_attributes SendEmailTo.run!(person_id: 'some_person_id', attributes: email_attributes) end it 'defaults the content_type to text/html' do email_attributes = {subject: 'some_subject', body: 'some_body', bcc: 'some@bcc', mail_type: 'some_mail_type'} expect(session).to receive(:post).with '/emails', person_id: 'some_person_id', email: email_attributes.merge(content_type: 'text/html') SendEmailTo.run!(person_id: 'some_person_id', attributes: email_attributes) end end
Version data entries
35 entries across 35 versions & 1 rubygems