forked from External/greenlight
GRN2-247: Added Active Pending Banned Deleted tabs to manage users (#816)
* Added Active Pending Banned Deleted tabs to manage users * Removed hard coded strings * Fixed issues with sign in flow * Fixed issues with rooms not deleting
This commit is contained in:
committed by
Jesus Federico
parent
03bde37a2b
commit
49def8f405
@ -166,6 +166,37 @@ describe AdminsController, type: :controller do
|
||||
expect { post :approve, params: params }.to change { ActionMailer::Base.deliveries.count }.by(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "POST #undelete" do
|
||||
it "undeletes a user" do
|
||||
@request.session[:user_id] = @admin.id
|
||||
|
||||
@user.delete
|
||||
|
||||
expect(User.find_by(uid: @user.uid)).to be_nil
|
||||
|
||||
post :undelete, params: { user_uid: @user.uid }
|
||||
|
||||
expect(User.find_by(uid: @user.uid)).to be_present
|
||||
expect(flash[:success]).to be_present
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
|
||||
it "undeletes the users rooms" do
|
||||
@request.session[:user_id] = @admin.id
|
||||
|
||||
@user.main_room.delete
|
||||
@user.delete
|
||||
|
||||
expect(Room.find_by(uid: @user.main_room.uid)).to be_nil
|
||||
|
||||
post :undelete, params: { user_uid: @user.uid }
|
||||
|
||||
expect(Room.find_by(uid: @user.main_room.uid)).to be_present
|
||||
expect(flash[:success]).to be_present
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "User Design" do
|
||||
|
Reference in New Issue
Block a user