Sha256: 87e542034deab3fd1fcf3c272da2c1b626384d4f254f0cb1c62b83027c73091f
Contents?: true
Size: 1.73 KB
Versions: 6
Compression:
Stored size: 1.73 KB
Contents
require 'spec_helper' describe SendInviteEmail do let(:session) { Fabricate :roqua_core_api_oauth_session } context 'Dossier' do subject { SendInviteEmail.run! \ session: session, dossier_id: 'some_dossier_id', email_subject: 'account created', email_body: 'visit %create_account_link% to set password' } it 'performs a post on the send_invite_email api path' do expect(session).to receive(:post).with '/dossiers/some_dossier_id/send_invite_email', email_subject: 'account created', email_body: 'visit %create_account_link% to set password' subject end end context "Person" do subject { SendInviteEmail.run! \ session: session, person_id: 'some_person_id', email_subject: 'account created', email_body: 'visit %create_account_link% to set password' } it 'performs a post on the send_invite_email api path' do expect(session).to receive(:post).with '/people/some_person_id/send_invite_email', email_subject: 'account created', email_body: 'visit %create_account_link% to set password' subject end end context "Neither Dossier nor Person" do subject { SendInviteEmail.run \ session: session, email_subject: 'account created', email_body: 'visit %create_account_link% to set password' } it 'performs a post on the send_invite_email api path' do expect(subject).to be_invalid expect(subject.errors).to include :person_id end end end
Version data entries
6 entries across 6 versions & 1 rubygems