forked from bigbluebutton/greenlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Notify admins when a approval/invite user signs up"
This reverts commit 251d85d.
- Loading branch information
1 parent
251d85d
commit 0360c78
Showing
12 changed files
with
2 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,34 +223,6 @@ | |
|
||
expect(response).to redirect_to(root_path) | ||
end | ||
|
||
context 'registration notification emails' do | ||
before do | ||
allow(Rails.configuration).to receive(:enable_email_verification).and_return(true) | ||
@user = create(:user, provider: "greenlight") | ||
@admin = create(:user, provider: "greenlight", email: "[email protected]") | ||
@admin.add_role :admin | ||
end | ||
|
||
it "should notify admin on new user signup with approve/reject registration" do | ||
allow_any_instance_of(Registrar).to receive(:approval_registration).and_return(true) | ||
|
||
request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:bn_launcher] | ||
|
||
expect { get :omniauth, params: { provider: 'bn_launcher' } }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
|
||
it "should notify admin on new user signup with invite registration" do | ||
allow_any_instance_of(Registrar).to receive(:invite_registration).and_return(true) | ||
|
||
invite = Invitation.create(email: "[email protected]", provider: "greenlight") | ||
@request.session[:invite_token] = invite.invite_token | ||
|
||
request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:bn_launcher] | ||
|
||
expect { get :omniauth, params: { provider: 'bn_launcher' } }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
end | ||
end | ||
|
||
it "should not create session without omniauth env set for bn_launcher" do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,17 +186,6 @@ def random_valid_user_params | |
before do | ||
allow_any_instance_of(Registrar).to receive(:invite_registration).and_return(true) | ||
allow(Rails.configuration).to receive(:allow_user_signup).and_return(true) | ||
@user = create(:user, provider: "greenlight") | ||
@admin = create(:user, provider: "greenlight", email: "[email protected]") | ||
@admin.add_role :admin | ||
end | ||
|
||
it "should notify admins that user signed up" do | ||
params = random_valid_user_params | ||
invite = Invitation.create(email: params[:user][:email], provider: "greenlight") | ||
@request.session[:invite_token] = invite.invite_token | ||
|
||
expect { post :create, params: params }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
|
||
it "rejects the user if they are not invited" do | ||
|
@@ -251,9 +240,6 @@ def random_valid_user_params | |
before do | ||
allow_any_instance_of(Registrar).to receive(:approval_registration).and_return(true) | ||
allow(Rails.configuration).to receive(:allow_user_signup).and_return(true) | ||
@user = create(:user, provider: "greenlight") | ||
@admin = create(:user, provider: "greenlight", email: "[email protected]") | ||
@admin.add_role :admin | ||
end | ||
|
||
it "allows any user to sign up" do | ||
|
@@ -279,14 +265,6 @@ def random_valid_user_params | |
|
||
expect(u.has_role?(:pending)).to eq(true) | ||
end | ||
|
||
it "notifies admins that a user signed up" do | ||
allow(Rails.configuration).to receive(:enable_email_verification).and_return(true) | ||
|
||
params = random_valid_user_params | ||
|
||
expect { post :create, params: params }.to change { ActionMailer::Base.deliveries.count }.by(2) | ||
end | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,18 +35,4 @@ def approve_user | |
user = User.first | ||
UserMailer.approve_user(user, "http://example.com/", @logo, @color) | ||
end | ||
|
||
# Preview this email at | ||
# http://localhost:3000/rails/mailers/user_mailer/approval_user_signup | ||
def approval_user_signup | ||
user = User.first | ||
UserMailer.approval_user_signup(user, "http://example.com/", @logo, @color, "[email protected]") | ||
end | ||
|
||
# Preview this email at | ||
# http://localhost:3000/rails/mailers/user_mailer/invite_user_signup | ||
def invite_user_signup | ||
user = User.first | ||
UserMailer.invite_user_signup(user, "http://example.com/", @logo, @color, "[email protected]") | ||
end | ||
end |