ConfBuddies icon indicating copy to clipboard operation
ConfBuddies copied to clipboard

83 custom success message for your first friend

Open LittleBigProgramming opened this issue 3 years ago • 1 comments

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

  • [x] Added/changed specs for the changes made
  • [] Is the linting build successful?
  • [x] Is the test build successful?

User-Facing Changes

Screenshot 2021-10-27 at 13 46 25

LittleBigProgramming avatar Oct 27 '21 12:10 LittleBigProgramming

@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

LittleBigProgramming avatar Oct 27 '21 13:10 LittleBigProgramming