Remove link to reschedule if appointment group is not active

fixes LS-1915
flag=none

test plan:
- Enable the Scheduler setting for the account
- Create a published course with a teacher and a student
- Add an appointment group with at least one time slot as the teacher
- Sign up for the appointment as the student
- Delete the appointment as the teacher
- See the notification does not have a link to reschedule

Change-Id: I06a0f779a7b3690a460e9ac6403158509d7ae914
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260076
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
This commit is contained in:
Eric Saupe 2021-03-05 15:48:17 -07:00
parent dd7ff0df06
commit d463579618
2 changed files with 23 additions and 0 deletions

View File

@ -24,4 +24,6 @@
<%= before_label :cancel_reason, "Reason for canceling" %>
<%= data.cancel_reason || t(:no_reason_given, "none given") %>
<% if asset.appointment_group.active? -%>
<%= t :instructions, 'Sign up for a different time slot at the following link: %{link}', :link => content(:link) %>
<% end %>

View File

@ -60,6 +60,27 @@ describe 'appointment_deleted_for_user.email' do
expect(@message.body).to include(user.name)
expect(@message.body).to include(@group.name)
expect(@message.body).to include(@course.name)
expect(@message.body).to include("Sign up for a different time slot at the following link")
expect(@message.body).to include("/appointment_groups/#{@appointment_group.id}")
end
it "should exclude reschedule instructions if appointment group isn't active" do
user = user_model(:name => 'bob')
appointment_participant_model(:participant => user)
@appointment_group.destroy(@teacher)
@event.reload
generate_message(:appointment_deleted_for_user, :email, @event,
:data => {:updating_user_name => @teacher.name,
:cancel_reason => "just because"})
expect(@message.subject).to include('some title')
expect(@message.body).to include('some title')
expect(@message.body).to include('just because')
expect(@message.body).to include(@teacher.name)
expect(@message.body).to include(user.name)
expect(@message.body).to include(@course.name)
expect(@message.body).not_to include("Sign up for a different time slot at the following link")
expect(@message.body).not_to include("/appointment_groups/#{@appointment_group.id}")
end
end