mirror of
https://github.com/redmine/redmine.git
synced 2026-03-18 02:20:59 +01:00
Receive e-mail replies to news and news comments (#38274).
Patch by Felix Schäfer. git-svn-id: https://svn.redmine.org/redmine/trunk@22160 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -28,7 +28,7 @@ class MailHandlerTest < ActiveSupport::TestCase
|
||||
:workflows, :trackers, :projects_trackers,
|
||||
:versions, :enumerations, :issue_categories,
|
||||
:custom_fields, :custom_fields_trackers, :custom_fields_projects, :custom_values,
|
||||
:boards, :messages, :watchers
|
||||
:boards, :messages, :watchers, :news, :comments
|
||||
|
||||
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures/mail_handler'
|
||||
|
||||
@@ -1174,6 +1174,40 @@ class MailHandlerTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_reply_to_a_news
|
||||
m = submit_email('news_reply.eml')
|
||||
assert m.is_a?(Comment)
|
||||
assert !m.new_record?
|
||||
m.reload
|
||||
assert_equal News.find(1), m.commented
|
||||
assert_equal "This is a reply to a news.", m.content
|
||||
end
|
||||
|
||||
def test_reply_to_a_news_comment
|
||||
m = submit_email('news_comment_reply.eml')
|
||||
assert m.is_a?(Comment)
|
||||
assert !m.new_record?
|
||||
m.reload
|
||||
assert_equal News.find(1), m.commented
|
||||
assert_equal "This is a reply to a comment.", m.content
|
||||
end
|
||||
|
||||
def test_reply_to_a_nonexistant_news
|
||||
News.find(1).destroy
|
||||
assert_no_difference('Comment.count') do
|
||||
assert_not submit_email('news_reply.eml')
|
||||
assert_not submit_email('news_comment_reply.eml')
|
||||
end
|
||||
end
|
||||
|
||||
def test_reply_to_a_news_without_permission
|
||||
Role.all.each {|r| r.remove_permission! :comment_news}
|
||||
assert_no_difference('Comment.count') do
|
||||
assert_not submit_email('news_reply.eml')
|
||||
assert_not submit_email('news_comment_reply.eml')
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_convert_tags_of_html_only_emails
|
||||
with_settings :text_formatting => 'textile' do
|
||||
issue = submit_email('ticket_html_only.eml', :issue => {:project => 'ecookbook'})
|
||||
|
||||
Reference in New Issue
Block a user