Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
bc4eeb96
Commit
bc4eeb96
authored
Apr 24, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure replying to an individual note by email creates a note with its own discussion ID
parent
1005389f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
app/models/individual_note_discussion.rb
app/models/individual_note_discussion.rb
+4
-0
app/models/out_of_context_discussion.rb
app/models/out_of_context_discussion.rb
+5
-1
changelogs/unreleased/dm-fix-individual-notes-reply-attributes.yml
...s/unreleased/dm-fix-individual-notes-reply-attributes.yml
+5
-0
spec/models/sent_notification_spec.rb
spec/models/sent_notification_spec.rb
+8
-0
No files found.
app/models/individual_note_discussion.rb
View file @
bc4eeb96
...
...
@@ -10,4 +10,8 @@ class IndividualNoteDiscussion < Discussion
def
individual_note?
true
end
def
reply_attributes
super
.
tap
{
|
attrs
|
attrs
.
delete
(
:discussion_id
)
}
end
end
app/models/out_of_context_discussion.rb
View file @
bc4eeb96
...
...
@@ -19,4 +19,8 @@ class OutOfContextDiscussion < Discussion
def
self
.
note_class
Note
end
def
reply_attributes
super
.
tap
{
|
attrs
|
attrs
.
delete
(
:discussion_id
)
}
end
end
changelogs/unreleased/dm-fix-individual-notes-reply-attributes.yml
0 → 100644
View file @
bc4eeb96
---
title
:
Ensure replying to an individual note by email creates a note with its own
discussion ID
merge_request
:
author
:
spec/models/sent_notification_spec.rb
View file @
bc4eeb96
...
...
@@ -69,6 +69,7 @@ describe SentNotification, model: true do
it
'creates a comment on the issue'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
not_to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -79,6 +80,7 @@ describe SentNotification, model: true do
it
'creates a reply on the discussion'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -99,6 +101,7 @@ describe SentNotification, model: true do
it
'creates a comment on the merge request'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
not_to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -109,6 +112,7 @@ describe SentNotification, model: true do
it
'creates a reply on the discussion'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -119,6 +123,7 @@ describe SentNotification, model: true do
it
'creates a reply on the discussion'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -140,6 +145,7 @@ describe SentNotification, model: true do
it
'creates a comment on the commit'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
not_to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -150,6 +156,7 @@ describe SentNotification, model: true do
it
'creates a reply on the discussion'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
to
eq
(
note
.
discussion_id
)
end
end
...
...
@@ -160,6 +167,7 @@ describe SentNotification, model: true do
it
'creates a reply on the discussion'
do
new_note
=
subject
.
create_reply
(
'Test'
)
expect
(
new_note
.
in_reply_to?
(
note
)).
to
be_truthy
expect
(
new_note
.
discussion_id
).
to
eq
(
note
.
discussion_id
)
end
end
end
...
...
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