You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/spec/models/recipient_list_spec.rb

22 lines
740 B

require 'rails_helper'
describe RecipientList do
describe "Save" do
it "should convert the recipient_id_array into the recipient_ids attribute" do
recipient_list = RecipientList.create(name: 'Name', recipient_id_array: ['', '1', '2', '3'])
expect(recipient_list).to be_a(RecipientList)
expect(recipient_list).to be_persisted
expect(recipient_list.recipient_ids).to eq('1,2,3')
recipient_list.update(recipient_id_array: ['3', '', '4', '5', '6'])
expect(recipient_list.reload.recipient_ids).to eq('3,4,5,6')
end
end
describe "when edited" do
it 'should delete recipient_schedules if a recipient is removed'
it 'should create recipient_schedules if a recipient is added'
end
end