Remove private post content of also commented mails

merges #5931
This commit is contained in:
Steffen van Bergerem 2015-05-06 00:55:18 +02:00 committed by Dennis Schubert
parent a7699c2a2c
commit 06e6e1db78
4 changed files with 196 additions and 139 deletions

View file

@ -31,6 +31,7 @@
* Support syntax highlighting for fenced code blocks [#5908](https://github.com/diaspora/diaspora/pull/5908) * Support syntax highlighting for fenced code blocks [#5908](https://github.com/diaspora/diaspora/pull/5908)
* Added link to diasporafoundation.org to invitation email [#5893](https://github.com/diaspora/diaspora/pull/5893) * Added link to diasporafoundation.org to invitation email [#5893](https://github.com/diaspora/diaspora/pull/5893)
* Gracefully handle missing `og:url`s [#5926](https://github.com/diaspora/diaspora/pull/5926) * Gracefully handle missing `og:url`s [#5926](https://github.com/diaspora/diaspora/pull/5926)
* Remove private post content from "also commented" mails [#5931](https://github.com/diaspora/diaspora/pull/5931)
# 0.5.0.1 # 0.5.0.1

View file

@ -8,7 +8,11 @@ module NotificationMailers
if mail? if mail?
@headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>" @headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
if @comment.public?
@headers[:subject] = "Re: #{@comment.comment_email_subject}" @headers[:subject] = "Re: #{@comment.comment_email_subject}"
else
@headers[:subject] = I18n.t("notifier.also_commented.limited_subject")
end
end end
end end

View file

@ -754,8 +754,10 @@ en:
sharing: "has started sharing with you!" sharing: "has started sharing with you!"
view_profile: "View %{name}s profile" view_profile: "View %{name}s profile"
comment_on_post: comment_on_post:
limited_subject: "There's a new comment on a post you commented" limited_subject: "There's a new comment on one of your posts"
reply: "Reply or view %{name}s post >" reply: "Reply or view %{name}s post >"
also_commented:
limited_subject: "There's a new comment on a post you commented"
mentioned: mentioned:
subject: "%{name} has mentioned you on diaspora*" subject: "%{name} has mentioned you on diaspora*"
mentioned: "mentioned you in a post:" mentioned: "mentioned you in a post:"

View file

@ -1,14 +1,14 @@
require 'spec_helper' require "spec_helper"
describe Notifier, :type => :mailer do describe Notifier, type: :mailer do
let(:person) { FactoryGirl.create(:person) } let(:person) { FactoryGirl.create(:person) }
before do before do
Notifier.deliveries = [] Notifier.deliveries = []
end end
describe '.administrative' do describe ".administrative" do
it 'mails a user' do it "mails a user" do
mails = Notifier.admin("Welcome to bureaucracy!", [bob]) mails = Notifier.admin("Welcome to bureaucracy!", [bob])
expect(mails.length).to eq(1) expect(mails.length).to eq(1)
mail = mails.first mail = mails.first
@ -17,25 +17,26 @@ describe Notifier, :type => :mailer do
expect(mail.body.encoded).to match /#{bob.username}/ expect(mail.body.encoded).to match /#{bob.username}/
end end
context 'mails a bunch of users' do context "mails a bunch of users" do
before do before do
@users = [] @users = []
5.times do 5.times do
@users << FactoryGirl.create(:user) @users << FactoryGirl.create(:user)
end end
end end
it 'has a body' do it "has a body" do
mails = Notifier.admin("Welcome to bureaucracy!", @users) mails = Notifier.admin("Welcome to bureaucracy!", @users)
expect(mails.length).to eq(5) expect(mails.length).to eq(5)
mails.each {|mail| mails.each {|mail|
this_user = @users.detect{|u| mail.to == [u.email]} this_user = @users.find {|u| mail.to == [u.email] }
expect(mail.body.encoded).to match /Welcome to bureaucracy!/ expect(mail.body.encoded).to match /Welcome to bureaucracy!/
expect(mail.body.encoded).to match /#{this_user.username}/ expect(mail.body.encoded).to match /#{this_user.username}/
} }
end end
it "has attachments" do it "has attachments" do
mails = Notifier.admin("Welcome to bureaucracy!", @users, :attachments => [{:name => "retention stats", :file => "here is some file content"}]) mails = Notifier.admin("Welcome to bureaucracy!", @users,
attachments: [{name: "retention stats", file: "here is some file content"}])
expect(mails.length).to eq(5) expect(mails.length).to eq(5)
mails.each {|mail| mails.each {|mail|
expect(mail.attachments.count).to eq(1) expect(mail.attachments.count).to eq(1)
@ -44,21 +45,22 @@ describe Notifier, :type => :mailer do
end end
end end
describe '.single_admin' do describe ".single_admin" do
it 'mails a user' do it "mails a user" do
mail = Notifier.single_admin("Welcome to bureaucracy!", bob) mail = Notifier.single_admin("Welcome to bureaucracy!", bob)
expect(mail.to).to eq([bob.email]) expect(mail.to).to eq([bob.email])
expect(mail.body.encoded).to match /Welcome to bureaucracy!/ expect(mail.body.encoded).to match /Welcome to bureaucracy!/
expect(mail.body.encoded).to match /#{bob.username}/ expect(mail.body.encoded).to match /#{bob.username}/
end end
it 'has the layout' do it "has the layout" do
mail = Notifier.single_admin("Welcome to bureaucracy!", bob) mail = Notifier.single_admin("Welcome to bureaucracy!", bob)
expect(mail.body.encoded).to match /change your notification settings/ expect(mail.body.encoded).to match /change your notification settings/
end end
it 'has an optional attachment' do it "has an optional attachment" do
mail = Notifier.single_admin("Welcome to bureaucracy!", bob, :attachments => [{:name => "retention stats", :file => "here is some file content"}]) mail = Notifier.single_admin("Welcome to bureaucracy!", bob,
attachments: [{name: "retention stats", file: "here is some file content"}])
expect(mail.attachments.length).to eq(1) expect(mail.attachments.length).to eq(1)
end end
end end
@ -66,15 +68,15 @@ describe Notifier, :type => :mailer do
describe ".started_sharing" do describe ".started_sharing" do
let!(:request_mail) { Notifier.started_sharing(bob.id, person.id) } let!(:request_mail) { Notifier.started_sharing(bob.id, person.id) }
it 'goes to the right person' do it "goes to the right person" do
expect(request_mail.to).to eq([bob.email]) expect(request_mail.to).to eq([bob.email])
end end
it 'has the name of person sending the request' do it "has the name of person sending the request" do
expect(request_mail.body.encoded.include?(person.name)).to be true expect(request_mail.body.encoded.include?(person.name)).to be true
end end
it 'has the css' do it "has the css" do
request_mail.body.encoded.include?("<style type='text/css'>") request_mail.body.encoded.include?("<style type='text/css'>")
end end
end end
@ -83,25 +85,25 @@ describe Notifier, :type => :mailer do
before do before do
@user = alice @user = alice
@post = FactoryGirl.create(:status_message, public: true) @post = FactoryGirl.create(:status_message, public: true)
@mention = Mention.create(:person => @user.person, :post => @post) @mention = Mention.create(person: @user.person, post: @post)
@mail = Notifier.mentioned(@user.id, @post.author.id, @mention.id) @mail = Notifier.mentioned(@user.id, @post.author.id, @mention.id)
end end
it 'TO: goes to the right person' do it "TO: goes to the right person" do
expect(@mail.to).to eq([@user.email]) expect(@mail.to).to eq([@user.email])
end end
it 'SUBJECT: has the name of person mentioning in the subject' do it "SUBJECT: has the name of person mentioning in the subject" do
expect(@mail.subject).to include(@post.author.name) expect(@mail.subject).to include(@post.author.name)
end end
it 'has the post text in the body' do it "has the post text in the body" do
expect(@mail.body.encoded).to include(@post.text) expect(@mail.body.encoded).to include(@post.text)
end end
it 'should not include translation fallback' do it "should not include translation fallback" do
expect(@mail.body.encoded).not_to include(I18n.translate 'notifier.a_post_you_shared') expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end end
end end
@ -133,37 +135,7 @@ describe Notifier, :type => :mailer do
describe ".liked" do describe ".liked" do
before do before do
@post = FactoryGirl.create(:status_message, :author => alice.person, :public => true) @post = FactoryGirl.create(:status_message, author: alice.person, public: true)
@like = @post.likes.create!(:author => bob.person)
@mail = Notifier.liked(alice.id, @like.author.id, @like.id)
end
it 'TO: goes to the right person' do
expect(@mail.to).to eq([alice.email])
end
it 'BODY: contains the original post' do
expect(@mail.body.encoded).to include(@post.message.plain_text)
end
it 'BODY: contains the name of person liking' do
expect(@mail.body.encoded).to include(@like.author.name)
end
it 'should not include translation fallback' do
expect(@mail.body.encoded).not_to include(I18n.translate 'notifier.a_post_you_shared')
end
it 'can handle a reshare' do
reshare = FactoryGirl.create(:reshare)
like = reshare.likes.create!(:author => bob.person)
Notifier.liked(alice.id, like.author.id, like.id)
end
end
describe ".liked limited" do
before do
@post = FactoryGirl.create(:status_message, author: alice.person, public: false)
@like = @post.likes.create!(author: bob.person) @like = @post.likes.create!(author: bob.person)
@mail = Notifier.liked(alice.id, @like.author.id, @like.id) @mail = Notifier.liked(alice.id, @like.author.id, @like.id)
end end
@ -172,8 +144,8 @@ describe Notifier, :type => :mailer do
expect(@mail.to).to eq([alice.email]) expect(@mail.to).to eq([alice.email])
end end
it "BODY: not contains the original post" do it "BODY: contains the original post" do
expect(@mail.body.encoded).not_to include(@post.message.plain_text) expect(@mail.body.encoded).to include(@post.message.plain_text)
end end
it "BODY: contains the name of person liking" do it "BODY: contains the name of person liking" do
@ -183,43 +155,48 @@ describe Notifier, :type => :mailer do
it "should not include translation fallback" do it "should not include translation fallback" do
expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared") expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end end
it "can handle a reshare" do
reshare = FactoryGirl.create(:reshare)
like = reshare.likes.create!(author: bob.person)
Notifier.liked(alice.id, like.author.id, like.id)
end
end end
describe ".reshared" do describe ".reshared" do
before do before do
@post = FactoryGirl.create(:status_message, :author => alice.person, :public => true) @post = FactoryGirl.create(:status_message, author: alice.person, public: true)
@reshare = FactoryGirl.create(:reshare, :root => @post, :author => bob.person) @reshare = FactoryGirl.create(:reshare, root: @post, author: bob.person)
@mail = Notifier.reshared(alice.id, @reshare.author.id, @reshare.id) @mail = Notifier.reshared(alice.id, @reshare.author.id, @reshare.id)
end end
it 'TO: goes to the right person' do it "TO: goes to the right person" do
expect(@mail.to).to eq([alice.email]) expect(@mail.to).to eq([alice.email])
end end
it 'BODY: contains the truncated original post' do it "BODY: contains the truncated original post" do
expect(@mail.body.encoded).to include(@post.message.plain_text) expect(@mail.body.encoded).to include(@post.message.plain_text)
end end
it 'BODY: contains the name of person liking' do it "BODY: contains the name of person liking" do
expect(@mail.body.encoded).to include(@reshare.author.name) expect(@mail.body.encoded).to include(@reshare.author.name)
end end
it 'should not include translation fallback' do it "should not include translation fallback" do
expect(@mail.body.encoded).not_to include(I18n.translate 'notifier.a_post_you_shared') expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end end
end end
describe ".private_message" do describe ".private_message" do
before do before do
@user2 = bob @user2 = bob
@participant_ids = @user2.contacts.map {|c| c.person.id } + [@user2.person.id] @participant_ids = @user2.contacts.map {|c| c.person.id } + [@user2.person.id]
@create_hash = { @create_hash = {
:author => @user2.person, author: @user2.person,
:participant_ids => @participant_ids, participant_ids: @participant_ids,
:subject => "cool stuff", subject: "cool stuff",
:messages_attributes => [ {:author => @user2.person, :text => 'hey'} ] messages_attributes: [{author: @user2.person, text: "hey"}]
} }
@cnv = Conversation.create(@create_hash) @cnv = Conversation.create(@create_hash)
@ -227,7 +204,7 @@ describe Notifier, :type => :mailer do
@mail = Notifier.private_message(bob.id, @cnv.author.id, @cnv.messages.first.id) @mail = Notifier.private_message(bob.id, @cnv.author.id, @cnv.messages.first.id)
end end
it 'TO: goes to the right person' do it "TO: goes to the right person" do
expect(@mail.to).to eq([bob.email]) expect(@mail.to).to eq([bob.email])
end end
@ -235,34 +212,39 @@ describe Notifier, :type => :mailer do
expect(@mail["From"].to_s).to eq("\"#{@cnv.author.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>") expect(@mail["From"].to_s).to eq("\"#{@cnv.author.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>")
end end
it 'SUBJECT: has a snippet of the post contents' do it "SUBJECT: has a snippet of the post contents" do
expect(@mail.subject).to eq(@cnv.subject) expect(@mail.subject).to eq(@cnv.subject)
end end
it 'SUBJECT: has "Re:" if not the first message in a conversation' do it "SUBJECT: has 'Re:' if not the first message in a conversation" do
@cnv.messages << Message.new(:text => 'yo', :author => eve.person) @cnv.messages << Message.new(text: "yo", author: eve.person)
@mail = Notifier.private_message(bob.id, @cnv.author.id, @cnv.messages.last.id) @mail = Notifier.private_message(bob.id, @cnv.author.id, @cnv.messages.last.id)
expect(@mail.subject).to eq("Re: #{@cnv.subject}") expect(@mail.subject).to eq("Re: #{@cnv.subject}")
end end
it 'BODY: does not contain the message text' do it "BODY: does not contain the message text" do
expect(@mail.body.encoded).not_to include(@cnv.messages.first.text) expect(@mail.body.encoded).not_to include(@cnv.messages.first.text)
end end
it 'should not include translation fallback' do it "should not include translation fallback" do
expect(@mail.body.encoded).not_to include(I18n.translate 'notifier.a_post_you_shared') expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end end
end end
context "comments" do context "comments" do
let(:commented_post) {bob.post(:status_message, :text => "### Headline \r\n It's **really** sunny outside today, and this is a super long status message! #notreally", :to => :all, :public => true)} let(:commented_post) {
bob.post(:status_message,
text: "### Headline \r\n It's **really** sunny outside today, and this is a super long status message! #notreally",
to: :all,
public: true)
}
let(:comment) { eve.comment!(commented_post, "Totally is") } let(:comment) { eve.comment!(commented_post, "Totally is") }
describe ".comment_on_post" do describe ".comment_on_post" do
let(:comment_mail) { Notifier.comment_on_post(bob.id, person.id, comment.id).deliver_now } let(:comment_mail) { Notifier.comment_on_post(bob.id, person.id, comment.id).deliver_now }
it 'TO: goes to the right person' do it "TO: goes to the right person" do
expect(comment_mail.to).to eq([bob.email]) expect(comment_mail.to).to eq([bob.email])
end end
@ -270,28 +252,28 @@ describe Notifier, :type => :mailer do
expect(comment_mail["From"].to_s).to eq("\"#{eve.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>") expect(comment_mail["From"].to_s).to eq("\"#{eve.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>")
end end
it 'SUBJECT: has a snippet of the post contents, without markdown and without newlines' do it "SUBJECT: has a snippet of the post contents, without markdown and without newlines" do
expect(comment_mail.subject).to eq("Re: Headline") expect(comment_mail.subject).to eq("Re: Headline")
end end
context 'BODY' do context "BODY" do
it "contains the comment" do it "contains the comment" do
expect(comment_mail.body.encoded).to include(comment.text) expect(comment_mail.body.encoded).to include(comment.text)
end end
it "contains the original post's link" do it "contains the original post's link" do
expect(comment_mail.body.encoded.include?("#{comment.post.id.to_s}")).to be true expect(comment_mail.body.encoded.include?("#{comment.post.id}")).to be true
end end
it 'should not include translation fallback' do it "should not include translation fallback" do
expect(comment_mail.body.encoded).not_to include(I18n.translate 'notifier.a_post_you_shared') expect(comment_mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end end
end end
[:reshare].each do |post_type| [:reshare].each do |post_type|
context post_type.to_s do context post_type.to_s do
let(:commented_post) { FactoryGirl.create(post_type, :author => bob.person) } let(:commented_post) { FactoryGirl.create(post_type, author: bob.person) }
it 'succeeds' do it "succeeds" do
expect { expect {
comment_mail comment_mail
}.not_to raise_error }.not_to raise_error
@ -303,35 +285,35 @@ describe Notifier, :type => :mailer do
describe ".also_commented" do describe ".also_commented" do
let(:comment_mail) { Notifier.also_commented(bob.id, person.id, comment.id) } let(:comment_mail) { Notifier.also_commented(bob.id, person.id, comment.id) }
it 'TO: goes to the right person' do it "TO: goes to the right person" do
expect(comment_mail.to).to eq([bob.email]) expect(comment_mail.to).to eq([bob.email])
end end
it 'FROM: has the name of person commenting as the sender' do it "FROM: has the name of person commenting as the sender" do
expect(comment_mail["From"].to_s).to eq("\"#{eve.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>") expect(comment_mail["From"].to_s).to eq("\"#{eve.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>")
end end
it 'SUBJECT: has a snippet of the post contents, without markdown and without newlines' do it "SUBJECT: has a snippet of the post contents, without markdown and without newlines" do
expect(comment_mail.subject).to eq("Re: Headline") expect(comment_mail.subject).to eq("Re: Headline")
end end
context 'BODY' do context "BODY" do
it "contains the comment" do it "contains the comment" do
expect(comment_mail.body.encoded).to include(comment.text) expect(comment_mail.body.encoded).to include(comment.text)
end end
it "contains the original post's link" do it "contains the original post's link" do
expect(comment_mail.body.encoded).to include("#{comment.post.id.to_s}") expect(comment_mail.body.encoded).to include("#{comment.post.id}")
end end
it 'should not include translation fallback' do it "should not include translation fallback" do
expect(comment_mail.body.encoded).not_to include(I18n.translate 'notifier.a_post_you_shared') expect(comment_mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end end
end end
[:reshare].each do |post_type| [:reshare].each do |post_type|
context post_type.to_s do context post_type.to_s do
let(:commented_post) { FactoryGirl.create(post_type, :author => bob.person) } let(:commented_post) { FactoryGirl.create(post_type, author: bob.person) }
it 'succeeds' do it "succeeds" do
expect { expect {
comment_mail comment_mail
}.not_to raise_error }.not_to raise_error
@ -339,6 +321,96 @@ describe Notifier, :type => :mailer do
end end
end end
end end
end
context "limited post" do
let(:limited_post) {
alice.post(:status_message, to: :all, public: false,
text: "### Limited headline \r\n It's **really** sunny outside today")
}
context "comments" do
let(:comment) { bob.comment!(limited_post, "Totally is") }
describe ".also_commented" do
let(:mail) { Notifier.also_commented(alice.id, bob.person.id, comment.id) }
it "TO: goes to the right person" do
expect(mail.to).to eq([alice.email])
end
it "FROM: contains the sender's name" do
expect(mail["From"].to_s).to eq("\"#{bob.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>")
end
it "SUBJECT: does not show the limited post" do
expect(mail.subject).not_to include("Limited headline")
end
it "BODY: does not show limited message" do
expect(mail.body.encoded).not_to include("Limited headline")
end
it "BODY: does not show the comment" do
expect(mail.body.encoded).not_to include("Totally is")
end
end
describe ".comment_on_post" do
let(:comment) { bob.comment!(limited_post, "Totally is") }
let(:mail) { Notifier.comment_on_post(alice.id, bob.person.id, comment.id) }
it "TO: goes to the right person" do
expect(mail.to).to eq([alice.email])
end
it "FROM: contains the sender's name" do
expect(mail["From"].to_s).to eq("\"#{bob.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>")
end
it "SUBJECT: does not show the limited post" do
expect(mail.subject).not_to include("Limited headline")
end
it "BODY: does not show the limited post" do
expect(mail.body.encoded).not_to include("Limited headline")
end
it "BODY: does not show the comment" do
expect(mail.body.encoded).not_to include("Totally is")
end
end
end
describe ".liked" do
let(:like) { bob.like!(limited_post) }
let(:mail) { Notifier.liked(alice.id, bob.person.id, like.id) }
it "TO: goes to the right person" do
expect(mail.to).to eq([alice.email])
end
it "FROM: contains the sender's name" do
expect(mail["From"].to_s).to eq("\"#{bob.name} (diaspora*)\" <#{AppConfig.mail.sender_address}>")
end
it "SUBJECT: does not show the limited post" do
expect(mail.subject).not_to include("Limited headline")
end
it "BODY: does not show the limited post" do
expect(mail.body.encoded).not_to include("Limited headline")
end
it "BODY: contains the name of person liking" do
expect(mail.body.encoded).to include(bob.name)
end
it "should not include translation fallback" do
expect(mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
end
end
end
describe ".confirm_email" do describe ".confirm_email" do
before do before do
@ -346,50 +418,29 @@ describe Notifier, :type => :mailer do
@confirm_email = Notifier.confirm_email(bob.id) @confirm_email = Notifier.confirm_email(bob.id)
end end
it 'goes to the right person' do it "goes to the right person" do
expect(@confirm_email.to).to eq([bob.unconfirmed_email]) expect(@confirm_email.to).to eq([bob.unconfirmed_email])
end end
it 'has the unconfirmed emil in the subject' do it "has the unconfirmed emil in the subject" do
expect(@confirm_email.subject).to include(bob.unconfirmed_email) expect(@confirm_email.subject).to include(bob.unconfirmed_email)
end end
it 'has the unconfirmed emil in the body' do it "has the unconfirmed emil in the body" do
expect(@confirm_email.body.encoded).to include(bob.unconfirmed_email) expect(@confirm_email.body.encoded).to include(bob.unconfirmed_email)
end end
it 'has the receivers name in the body' do it "has the receivers name in the body" do
expect(@confirm_email.body.encoded).to include(bob.person.profile.first_name) expect(@confirm_email.body.encoded).to include(bob.person.profile.first_name)
end end
it 'has the activation link in the body' do it "has the activation link in the body" do
expect(@confirm_email.body.encoded).to include(confirm_email_url(:token => bob.confirm_email_token)) expect(@confirm_email.body.encoded).to include(confirm_email_url(token: bob.confirm_email_token))
end
end end
end end
context "limited comments" do describe "hashtags" do
let(:commented_limited_post) { it "escapes hashtags" do
bob.post(:status_message, to: :all, public: false,
text: "### Limited headline \r\n It's **really** sunny outside today")
}
let(:limited_comment) { eve.comment!(commented_limited_post, "Totally is") }
describe ".comment_on_limited_post" do
let(:limited_comment_mail) { Notifier.comment_on_post(bob.id, person.id, limited_comment.id).deliver_now }
it "SUBJECT: does not show limited message" do
expect(limited_comment_mail.subject).not_to include("Limited headline")
end
it "BODY: does not show limited message" do
expect(limited_comment_mail.body.encoded).not_to include("Limited headline")
end
end
end
describe 'hashtags' do
it 'escapes hashtags' do
mails = Notifier.admin("#Welcome to bureaucracy!", [bob]) mails = Notifier.admin("#Welcome to bureaucracy!", [bob])
expect(mails.length).to eq(1) expect(mails.length).to eq(1)
mail = mails.first mail = mails.first
@ -399,7 +450,6 @@ describe Notifier, :type => :mailer do
describe "base" do describe "base" do
it "handles idn addresses" do it "handles idn addresses" do
# user = FactoryGirl.create(:user, email: "ŧoo@ŧexample.com")
bob.update_attribute(:email, "ŧoo@ŧexample.com") bob.update_attribute(:email, "ŧoo@ŧexample.com")
expect { expect {
Notifier.started_sharing(bob.id, person.id) Notifier.started_sharing(bob.id, person.id)