Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gigadoc 2
diaspora
Commits
08e108d3
Unverified
Commit
08e108d3
authored
Sep 05, 2018
by
Benjamin Neff
Committed by
Dennis Schubert
Sep 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comment notification subject for posts without text
Fixes #7854
parent
546ef080
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
Changelog.md
Changelog.md
+1
-0
app/models/status_message.rb
app/models/status_message.rb
+5
-1
spec/models/status_message_spec.rb
spec/models/status_message_spec.rb
+12
-0
No files found.
Changelog.md
View file @
08e108d3
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
## Bug fixes
## Bug fixes
*
Add compatibility with macOS to
`script/configure_bundler`
[
#7830
](
https://github.com/diaspora/diaspora/pull/7830
)
*
Add compatibility with macOS to
`script/configure_bundler`
[
#7830
](
https://github.com/diaspora/diaspora/pull/7830
)
*
Fix comment notifications for comments on posts without text
[
#7857
](
https://github.com/diaspora/diaspora/pull/7857
)
## Features
## Features
*
Add
`web+diaspora://`
link handler
[
#7826
](
https://github.com/diaspora/diaspora/pull/7826
)
*
Add
`web+diaspora://`
link handler
[
#7826
](
https://github.com/diaspora/diaspora/pull/7826
)
...
...
app/models/status_message.rb
View file @
08e108d3
...
@@ -62,7 +62,11 @@ class StatusMessage < Post
...
@@ -62,7 +62,11 @@ class StatusMessage < Post
end
end
def
comment_email_subject
def
comment_email_subject
message
.
title
if
message
.
present?
message
.
title
elsif
photos
.
present?
I18n
.
t
(
"posts.show.photos_by"
,
count:
photos
.
size
,
author:
author_name
)
end
end
end
def
first_photo_url
(
*
args
)
def
first_photo_url
(
*
args
)
...
...
spec/models/status_message_spec.rb
View file @
08e108d3
...
@@ -170,6 +170,18 @@ describe StatusMessage, type: :model do
...
@@ -170,6 +170,18 @@ describe StatusMessage, type: :model do
end
end
end
end
describe
"#comment_email_subject"
do
it
"delegates to message.title if the post have a text"
do
expect
(
status
.
comment_email_subject
).
to
eq
(
status
.
message
.
title
)
end
it
"includes the photos count if there are photos without text"
do
photo
=
FactoryGirl
.
build
(
:photo
,
public:
true
)
status
=
FactoryGirl
.
build
(
:status_message
,
author:
photo
.
author
,
text:
nil
,
photos:
[
photo
],
public:
true
)
expect
(
status
.
comment_email_subject
).
to
eq
(
I18n
.
t
(
"posts.show.photos_by"
,
count:
1
,
author:
status
.
author_name
))
end
end
describe
"tags"
do
describe
"tags"
do
it_should_behave_like
"it is taggable"
do
it_should_behave_like
"it is taggable"
do
let
(
:object
)
{
build
(
:status_message
)
}
let
(
:object
)
{
build
(
:status_message
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment