Skip to content

Commit

Permalink
- checked for user count changing when testing for #destroy for invit…
Browse files Browse the repository at this point in the history
…ations\n- fixed locale strings for revoking invites\n- other minor fixes
  • Loading branch information
alihadimazeh committed Jun 18, 2024
1 parent 93abcad commit f43c67c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions app/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@
"empty_invited_users_subtext": "When a user's status gets changed to invited, they will appear here.",
"invited": {
"time_sent": "Time Sent",
"valid": "Valid"
},
"revoke_invite": "Revoke Invite"
"valid": "Valid",
"revoke_invite": "Revoke Invite"
}
},
"server_rooms": {
"server_rooms": "Server Rooms",
Expand Down Expand Up @@ -430,7 +430,8 @@
"role_permission_updated": "The role permission has been updated."
},
"invitations": {
"invitation_sent": "An invitation has been sent."
"invitation_sent": "An invitation has been sent.",
"invitation_revoked": "An invitation has been revoked"
}
},
"error": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import EmptyUsersList from './EmptyUsersList';
import { localizeDateTimeString } from '../../../helpers/DateTimeHelper';
import { useAuth } from '../../../contexts/auth/AuthProvider';
import ManageUsersInvitedRowPlaceHolder from './ManageUsersInvitedRowPlaceHolder';
// import Modal from '../../shared_components/modals/Modal';
import useRevokeUserInvite from '../../../hooks/mutations/admin/manage_users/useRevokeUserInvite';

export default function InvitedUsersTable({ searchInput }) {
Expand Down Expand Up @@ -83,7 +82,7 @@ export default function InvitedUsersTable({ searchInput }) {
<Dropdown.Menu>
<Dropdown.Item onClick={() => revokeUserInvite.mutate(invitation.id)}>
<XCircleIcon className="hi-s me-2" />
{t('admin.manage_users.revoke_invite')}
{t('admin.manage_users.invited.revoke_invite')}
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/admin/invitations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@

describe 'invitation#destroy' do
it 'deletes the invitation' do
invitation = create(:invitation, email: 'faker@faker.com')
expect { delete :destroy, params: { id: invitation.id } }
invitation = create(:invitation)
expect { delete :destroy, params: { id: invitation.id } }.to change(Invitation, :count).by(-1)
expect(response).to have_http_status(:ok)
end

Expand Down

0 comments on commit f43c67c

Please sign in to comment.