Story #86 Add strip function to trainer email methods - cseseniordesign/reservations GitHub Wiki

End User Documentation

Dev Testing Instructions

  1. Make sure you are on the most recent version of the dev-add-strip-function-to-trainer-emails branch.
  2. Start your dev environment and log into your "Development x" account. These accounts only have a first name which is what previously caused the trainer emails to have unwanted whitespace after the name. This testing will not be conclusive if you use an account that has a last name.
  3. Make yourself a trainer if you are not already:
    1. Go to Admin > Users.
    2. Find yourself and click Edit.
    3. Check the Make Trainer box.
    4. Click Update.
  4. Create an event and assign yourself as the trainer:
    1. Go to Admin > Events.
    2. Create an event (either from a preset or from scratch).
    3. On the event creation page, click the Trainer: drop-down menu and select yourself.
    4. Set the event's start and end date to be in the future.
    5. Click Create Event.
    6. You should receive an email. In the email body, verify there is no whitespace between the last character of your name and the following period:
"Hi, Development 3." = correct        "Hi, Development 3 ." = incorrect
  1. Modify the event you are assigned to:
    1. Modify the previous event by editing the event and changing any details aside from the assigned trainer.
    2. Save the event.
    3. You should receive an email. In the email body, verify there is no whitespace between the last character of your name and the following period:
"Hi, Development 3." = correct        "Hi, Development 3 ." = incorrect
  1. Remove yourself from the event:
    1. Edit the same event from before. Click the Trainer: drop-down menu and set the event to have no trainer.
    2. Save the event.
    3. You should receive an email. In the email body, verify there is no whitespace between the last character of your name and the following period:
"Hi, Development 3." = correct        "Hi, Development 3 ." = incorrect
  1. Assign yourself as a trainer for the event once again and save the event.
    1. You should receive an email. You can disregard this.
  2. Delete the event you are assigned to. You should receive an email. In the email body, verify there is no whitespace between the last character of your name and the following period:
"Hi, Development 3." = correct        "Hi, Development 3 ." = incorrect
  1. The remaining method to be tested is the "Trainer Confirmation Reminder," which sends on a set schedule. If all of the above methods worked successfully, it is safe to assume the confirmation email will behave the same.

Technical Documentation

models/user.rb

  • Added .rstrip to the all of the trainer email methods. This will remove any trailing whitespace after the last character of the trainer's name.