-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_user_merger
- Loading branch information
Showing
13 changed files
with
126 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,15 +101,6 @@ def notify_member_that_they_received_allocation(admin: , member: , group: , amou | |
subject: "#{admin.name} gave you funds to spend in #{@group.name}") | ||
end | ||
|
||
def join_cobudget_and_create_group_invite(user: , inviter:) | ||
@user = user | ||
@inviter = inviter | ||
@redirect_url = "#{root_url}#/confirm_account?confirmation_token=#{@user.confirmation_token}&setup_group=true".html_safe | ||
mail(to: @user.name_and_email, | ||
from: "Cobudget Accounts <[email protected]>", | ||
subject: "#{inviter.name} invited you to create a new group on Cobudget") | ||
end | ||
|
||
def notify_funder_that_bucket_was_deleted(funder: , bucket: ) | ||
@bucket = bucket | ||
@group = @bucket.group | ||
|
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
11 changes: 0 additions & 11 deletions
11
app/views/user_mailer/join_cobudget_and_create_group_invite.erb
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,55 +160,6 @@ | |
end | ||
end | ||
|
||
describe "#invite_to_create_group" do | ||
before do | ||
make_user_group_admin | ||
request.headers.merge!(user.create_new_auth_token) | ||
end | ||
|
||
context "specified email does not yet exist in DB" do | ||
before do | ||
params = { email: Faker::Internet.email } | ||
post :invite_to_create_group, params | ||
@new_user = User.find_by(params) | ||
@sent_email = ActionMailer::Base.deliveries.first | ||
end | ||
|
||
after do | ||
ActionMailer::Base.deliveries.clear | ||
end | ||
|
||
it "creates a new user with confirmation token" do | ||
expect(@new_user).to be_truthy | ||
expect(@new_user.confirmation_token).to be_truthy | ||
end | ||
|
||
it "sends email to user with link to confirm account page containing confirmation_token and boolean setup_group set to true" do | ||
expect(@sent_email.to).to eq([@new_user.email]) | ||
expected_url = "/#/confirm_account?confirmation_token=#{@new_user.confirmation_token}&setup_group=true" | ||
expect(@sent_email.body.to_s).to include(expected_url) | ||
end | ||
end | ||
|
||
context "specified email already exists in DB" do | ||
before do | ||
make_user_group_admin | ||
request.headers.merge!(user.create_new_auth_token) | ||
create(:user, email: "[email protected]") | ||
@params = {email: "[email protected]"} | ||
post :invite_to_create_group, @params | ||
end | ||
|
||
it "does not create user" do | ||
expect(User.where(@params).length).to eq(1) | ||
end | ||
|
||
it "returns http status conflict" do | ||
expect(response).to have_http_status(:conflict) | ||
end | ||
end | ||
end | ||
|
||
describe "#update_profile" do | ||
context "user signed in" do | ||
before 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