|
|
|
@ -57,6 +57,20 @@ RSpec.describe RecipientSchedule, type: :model do
|
|
|
|
Timecop.freeze
|
|
|
|
Timecop.freeze
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe 'with an opted out recipient' do
|
|
|
|
|
|
|
|
before :each do
|
|
|
|
|
|
|
|
recipient_schedule.recipient.update_attributes(opted_out: true)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let!(:attempt) { recipient_schedule.attempt_question }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it 'should not do anything' do
|
|
|
|
|
|
|
|
expect(attempt).to be_nil
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe 'with an opted in recipient' do
|
|
|
|
let!(:attempt) { recipient_schedule.attempt_question }
|
|
|
|
let!(:attempt) { recipient_schedule.attempt_question }
|
|
|
|
|
|
|
|
|
|
|
|
it 'should make an attempt to ask the next question' do
|
|
|
|
it 'should make an attempt to ask the next question' do
|
|
|
|
@ -86,3 +100,4 @@ RSpec.describe RecipientSchedule, type: :model do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|