spec/communication_spec.rb in lifen-2.1.0 vs spec/communication_spec.rb in lifen-2.2.0
- old
+ new
@@ -9,13 +9,15 @@
let(:attachment) { Lifen::Attachment.new(title: "Master Plan", path: File.dirname(__FILE__) + "/support/master_plan.pdf", content_type: "application/pdf") }
let(:patient) { Lifen::Patient.new(first_name: "Jean", last_name: "Dupond", birthdate: Date.new(2000,1,1)) }
+ let(:binary) { Lifen::Binary.new(uuid: "valid_binary_id") }
- describe ':send' do
+ describe ':send with an Attachment' do
+
let(:communication) { Lifen::Communication.new(sender: sender, recipient: recipient, channel: channel, attachment: attachment, patient: patient) }
it 'works' do
VCR.use_cassette "communication/send/valid_attributes" do
communication.send
@@ -36,10 +38,25 @@
end
end
+ describe ':send with a Binary' do
+
+ let(:communication) { Lifen::Communication.new(sender: sender, recipient: recipient, channel: channel, binary: binary, patient: patient) }
+
+ it 'works' do
+
+ VCR.use_cassette "communication/send/binary_valid_attributes" do
+ communication.send
+ end
+
+ expect(communication.uuid).to_not be_nil
+ end
+
+ end
+
describe ':find' do
it 'works' do
VCR.use_cassette "communication/find/valid_uuid" do
@communication = Lifen::Communication.find "11e71070-15f9-23c1-9ad2-0242ac110002"
@@ -68,6 +85,6 @@
end
end
end
-end
\ No newline at end of file
+end