Support creates follow (Merge pull request #3895)

* Supporting a proposal will create a follow relationship
* Only followers receive notifications
This commit is contained in:
Andy Sims
2020-04-06 23:26:47 +10:00
committed by GitHub
parent 14106ce800
commit 74fbde09f1
17 changed files with 44 additions and 48 deletions

View File

@@ -249,11 +249,11 @@ describe "Emails" do
end
context "Proposal notification digest" do
scenario "notifications for proposals that I have supported" do
scenario "notifications for proposals that I'm following" do
user = create(:user, email_digest: true)
proposal1 = create(:proposal, voters: [user])
proposal2 = create(:proposal, voters: [user])
proposal1 = create(:proposal, followers: [user])
proposal2 = create(:proposal, followers: [user])
proposal3 = create(:proposal)
reset_mailer
@@ -288,6 +288,7 @@ describe "Emails" do
expect(email).not_to have_body_text(proposal3.title)
expect(email).to have_body_text(/#{account_path}/)
expect(email).to have_body_text("Visit this proposal and unfollow it to stop receiving notifications.")
notification1.reload
notification2.reload