Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
0a549d312f67
Commit
bc4eeb96
authored
Apr 24, 2017
by
Douwe Maan
Browse files
Ensure replying to an individual note by email creates a note with its own discussion ID
parent
1d6956e4ced3
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/models/individual_note_discussion.rb
View file @
0a549d31
...
...
@@ -10,4 +10,8 @@ def self.note_class
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 @
0a549d31
...
...
@@ -15,8 +15,12 @@ def self.build_discussion_id(note)
def
self
.
override_discussion_id
(
note
)
discussion_id
(
note
)
end
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 @
0a549d31
---
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 @
0a549d31
...
...
@@ -69,6 +69,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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