|
|
|
@ -42,7 +42,8 @@ RSpec.describe SchedulesController, type: :controller do
|
|
|
|
recipient_list_id: recipient_list.id,
|
|
|
|
recipient_list_id: recipient_list.id,
|
|
|
|
question_list_id: question_list.id,
|
|
|
|
question_list_id: question_list.id,
|
|
|
|
name: 'Parents Schedule',
|
|
|
|
name: 'Parents Schedule',
|
|
|
|
description: 'Schedule for parent questions'
|
|
|
|
description: 'Schedule for parent questions',
|
|
|
|
|
|
|
|
time: (8 * 60)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,6 +98,12 @@ RSpec.describe SchedulesController, type: :controller do
|
|
|
|
expect(assigns(:schedule)).to be_persisted
|
|
|
|
expect(assigns(:schedule)).to be_persisted
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "updates the schedule's time to UTC from EST" do
|
|
|
|
|
|
|
|
post :create, params: {school_id: school.id, schedule: valid_attributes}, session: valid_session
|
|
|
|
|
|
|
|
expect(assigns(:schedule)).to be_a(Schedule)
|
|
|
|
|
|
|
|
expect(assigns(:schedule).time).to eq(60 * 12)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it "redirects to the created schedule" do
|
|
|
|
it "redirects to the created schedule" do
|
|
|
|
post :create, params: {school_id: school.id, schedule: valid_attributes}, session: valid_session
|
|
|
|
post :create, params: {school_id: school.id, schedule: valid_attributes}, session: valid_session
|
|
|
|
expect(response).to redirect_to([school, Schedule.last])
|
|
|
|
expect(response).to redirect_to([school, Schedule.last])
|
|
|
|
|