forked from External/greenlight
GRN2-140: Added Email to inform user they've been promoted (#534)
* Added Email to inform user they've been promoted * Update user_mailer.rb * Send email when a user is demoted * Change more-info string
This commit is contained in:
committed by
Jesus Federico
parent
9638ebcbc5
commit
83a9edf81d
@ -64,6 +64,14 @@ describe AdminsController, type: :controller do
|
||||
expect(flash[:success]).to be_present
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
|
||||
it "sends an email to the user being promoted" do
|
||||
@request.session[:user_id] = @admin.id
|
||||
|
||||
params = { user_uid: @user.uid }
|
||||
|
||||
expect { post :promote, params: params }.to change { ActionMailer::Base.deliveries.count }.by(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "POST #demote" do
|
||||
@ -79,6 +87,16 @@ describe AdminsController, type: :controller do
|
||||
expect(flash[:success]).to be_present
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
|
||||
it "sends an email to the user being demoted" do
|
||||
@request.session[:user_id] = @admin.id
|
||||
|
||||
@user.add_role :admin
|
||||
|
||||
params = { user_uid: @user.uid }
|
||||
|
||||
expect { post :demote, params: params }.to change { ActionMailer::Base.deliveries.count }.by(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "POST #ban" do
|
||||
|
Reference in New Issue
Block a user