ChaelCodes / MeetAnotherDay

An app to help you find and meet up with your friends at conferences.
MIT License
35 stars 20 forks source link

83 custom success message for your first friend #116

Open LittleBigProgramming opened 2 years ago

LittleBigProgramming commented 2 years ago

Description of Feature or Issue

closes #83

ConfBuddies is a fun and playful app. When you accept your first friendship, send a custom message. "It's dangerous to go alone, take this Friend."

Added conditional within the update method of the friendships_controller to check if there is only 1 friendship with the status of accepted after the before_action :set_friendship has been called.

/spec/requests/friendships_spec.rb has been updated based on these changes to check the successful notice message depending on the condition.

Checklist

User-Facing Changes

Screenshot 2021-10-27 at 13 46 25
LittleBigProgramming commented 2 years ago

@ChaelCodes Do you have a convention for moving methods out of controllers? Or are you happy for me to move this check into a private method within the controller and call it from there? https://github.com/ChaelCodes/ConfBuddies/pull/116/files#:~:text=if-,Friendship,-.where(buddy_id%3A%20current_user