mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
fixing tests
This commit is contained in:
parent
061a3b9fde
commit
affc5aae53
2 changed files with 15 additions and 3 deletions
|
|
@ -124,8 +124,10 @@ describe "survey:attempt_questions" do
|
|||
|
||||
before :each do
|
||||
recipients[1].update_attributes(opted_out: true)
|
||||
Timecop.freeze
|
||||
subject.invoke
|
||||
|
||||
now = DateTime.now
|
||||
date = ActiveSupport::TimeZone["America/New_York"].parse(now.strftime("%Y-%m-%dT20:00:00%z"))
|
||||
Timecop.freeze(date) { subject.invoke }
|
||||
end
|
||||
|
||||
it 'should create the first attempt for each recipient' do
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ RSpec.describe RecipientSchedule, type: :model do
|
|||
end
|
||||
|
||||
describe 'ready' do
|
||||
before :each do
|
||||
now = DateTime.now
|
||||
date = ActiveSupport::TimeZone["America/New_York"].parse(now.strftime("%Y-%m-%dT16:00:00%z"))
|
||||
Timecop.freeze(date)
|
||||
end
|
||||
|
||||
subject { schedule.recipient_schedules.ready }
|
||||
|
||||
it ('should only provide recipient_schedules who are ready to send a message') do
|
||||
|
|
@ -96,7 +102,11 @@ RSpec.describe RecipientSchedule, type: :model do
|
|||
end
|
||||
|
||||
it 'should update next_attempt_at' do
|
||||
expect(recipient_schedule.next_attempt_at.to_i).to eq(Date.today.to_time.to_i + (960 * 60))
|
||||
now = DateTime.now
|
||||
date = ActiveSupport::TimeZone["America/New_York"].parse(now.strftime("%Y-%m-%dT16:00:00%z"))
|
||||
time = date.to_time.to_i + (60 * 60 * 24 * 7)
|
||||
|
||||
expect(recipient_schedule.next_attempt_at.to_i).to eq(time)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue