mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-15 19:58:08 +01:00
Extract behavior from Todo.from_rich_message
`Todo.from_rich_message` was partially tested from the MessageGateway, but it is mostly untested and does not belong in Todo due to it's unique nature. Extract it entirely from `Todo` into it's own dedicated object for unit testing.
This commit is contained in:
parent
0877bf9ab8
commit
c2111b2f8e
5 changed files with 101 additions and 54 deletions
|
|
@ -23,7 +23,8 @@ class MessageGateway < ActionMailer::Base
|
|||
end
|
||||
end
|
||||
|
||||
todo = Todo.from_rich_message(user, context.id, description, notes)
|
||||
todo_builder = TodoFromRichMessage.new(user, context.id, description, notes)
|
||||
todo = todo_builder.construct
|
||||
todo.save!
|
||||
Rails.logger.info "Saved email as todo for user #{user.login} in context #{context.name}"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue