improve receiver specs to account for posts approval

This commit is contained in:
Régis Hanol
2016-04-11 18:20:26 +02:00
parent 9bba68ed74
commit e4980392da
5 changed files with 40 additions and 5 deletions

View File

@ -375,7 +375,8 @@ module Email
options[:raw] << "</details>" << "\n"
end
manager = NewPostManager.new(options[:user], options)
user = options.delete(:user)
manager = NewPostManager.new(user, options)
result = manager.perform
raise InvalidPost, result.errors.full_messages.join("\n") if result.errors.any?
@ -383,7 +384,7 @@ module Email
if result.post
@incoming_email.update_columns(topic_id: result.post.topic_id, post_id: result.post.id)
if result.post.topic && result.post.topic.private_message?
add_other_addresses(result.post.topic, options[:user])
add_other_addresses(result.post.topic, user)
end
end
end