meyerhoferc / secret-santa

0 stars 0 forks source link

Joining groups #14

Closed kmeyerhofer closed 5 years ago

kmeyerhofer commented 6 years ago

This PR's base is based on PR #13

Invitations Added

As a group owner, you can invite a user to join the group. Your invite can contain a message to the user. You can invite a user in two ways:

  1. On the group page, you can send an invitation to a user's email. You must enter the email and a message.
  2. On another user's profile page (/users/:id) it will show a drop down menu of the groups you are an owner of. Select the group, write a message and submit your invitation to that user.

You can only send one invitation to a user at a time. If the user declines the invitation, you cannot invite them again.

If you have been invited to a group, your invitation will be at your /dashboard awaiting your Accept or Decline.

Groups

Users

Items

Gems

strong_password

Adds the strong_password gem. Users must use a strong password. Password strength is tested in spec/models/user_spec.rb.

database_cleaner

For testing only.

Gemfile

Dependency upgrades.

Database

Tests!

meyerhoferc commented 5 years ago

@kmeyerhofer Please resolve merge conflicts. I think this are appearing because I just merged wish-list into master.

meyerhoferc commented 5 years ago

Functional Testing Notes

Invitations

kmeyerhofer commented 5 years ago

Functional Testing Notes

Invitations

* Why are invitations on the user's show page? I don't see a way to find users other than knowing their ID to invite them to the group.

I wanted to have a second way for a group owner to invite someone. Yes, you do have to know their ID to invite them, that is definitely a big downside. I planned on adding a "request to join group" functionality which would allow a user to request to join a group. This might be added in the future.

  • In console, noticed issue with relationship between user + invitations. Can do invitation.user but not user.invitations. I think this is because the Invitation model has two relationships called user set. Fixed. Invitation now belongs to sender and receiver and User now has many received and sent
  • Invitations has show route but not action

Show route removed.

* I am able to accept another user's invitation by manually typing in `/accept/:invitation_id`

Fixed.

  • Unsure if this needs to be addressed: I was able to be added to a group twice when working through the console but not through the interface. Fixed. Adds validates_uniqueness_of :user_id, scope: :group_id to user_groups model

Groups

* works as advertised

Users

* Only issue is unable to update password, which I know you are working on separately.

This is being worked on in branch username.