Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2022-07-13 04:39:15 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2022-07-16 05:22:51 +0300
commit3c02a1f067b718e2d1806b65eef5bc9d9f446757 (patch)
tree9b01787a9656ad4bad4481d330e67a3aa2a20723
parenta9ae84f3a6b269247c68c172548b186bb643bf60 (diff)
Remove unused translation fallback
-rw-r--r--app/helpers/notifier_helper.rb6
-rw-r--r--spec/mailers/notifier_spec.rb32
2 files changed, 1 insertions, 37 deletions
diff --git a/app/helpers/notifier_helper.rb b/app/helpers/notifier_helper.rb
index e7a05af5f..9f268bd79 100644
--- a/app/helpers/notifier_helper.rb
+++ b/app/helpers/notifier_helper.rb
@@ -7,11 +7,7 @@ module NotifierHelper
# @param opts [Hash] Optional hash. Accepts :length parameters.
# @return [String] The formatted post.
def post_message(post, opts={})
- if post.respond_to? :message
- post.message.try(:plain_text_without_markdown).presence || post_page_title(post)
- else
- I18n.translate "notifier.a_post_you_shared"
- end
+ post.message&.plain_text_without_markdown.presence || post_page_title(post)
end
# @param comment [Comment] The comment to process.
diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb
index a8abde338..7e0830f41 100644
--- a/spec/mailers/notifier_spec.rb
+++ b/spec/mailers/notifier_spec.rb
@@ -121,10 +121,6 @@ describe Notifier, type: :mailer do
it "has the post text in the body" do
expect(@mail.body.encoded).to include(@post.text)
end
-
- it "should not include translation fallback" do
- expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
- end
end
describe ".mentioned_in_comment" do
@@ -180,10 +176,6 @@ describe Notifier, type: :mailer do
it "has the post text not in the body" do
expect(@mail.body.encoded).not_to include(@post.text)
end
-
- it "should not include translation fallback" do
- expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
- end
end
describe ".liked" do
@@ -205,10 +197,6 @@ describe Notifier, type: :mailer 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)
@@ -247,10 +235,6 @@ describe Notifier, type: :mailer do
it "BODY: contains the name of person liking" do
expect(@mail.body.encoded).to include(@reshare.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
end
describe ".private_message" do
@@ -294,10 +278,6 @@ describe Notifier, type: :mailer do
it "BODY: does not contain the message text" do
expect(@mail.body.encoded).not_to include(@cnv.messages.first.text)
end
-
- it "should not include translation fallback" do
- expect(@mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
- end
end
context "comments" do
@@ -334,10 +314,6 @@ describe Notifier, type: :mailer do
it "contains the original post's link with comment anchor" do
expect(comment_mail.body.encoded).to include("#{comment.post.id}##{comment.guid}")
end
-
- it "should not include translation fallback" do
- expect(comment_mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
- end
end
[:reshare].each do |post_type|
@@ -380,10 +356,6 @@ describe Notifier, type: :mailer do
it "contains the original post's link with comment anchor" do
expect(comment_mail.body.encoded).to include("#{comment.post.id}##{comment.guid}")
end
-
- it "should not include translation fallback" do
- expect(comment_mail.body.encoded).not_to include(I18n.translate "notifier.a_post_you_shared")
- end
end
[:reshare].each do |post_type|
context post_type.to_s do
@@ -490,10 +462,6 @@ describe Notifier, type: :mailer do
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