Просмотр исходного кода

Fixes #4244 - Zendesk import does not import comment create date inside of the created articles.

Dominik Klein 2 лет назад
Родитель
Сommit
07fa28df0c

+ 2 - 0
lib/sequencer/unit/import/zendesk/ticket/comment/mapping.rb

@@ -24,6 +24,8 @@ class Sequencer
                     message_id:    resource.id,
                     updated_by_id: user_id,
                     created_by_id: user_id,
+                    updated_at:    resource.created_at,
+                    created_at:    resource.created_at,
                     sender_id:     article_sender_id,
                     type_id:       article_type_id,
                   }

+ 6 - 4
spec/lib/sequencer/sequence/import/zendesk/ticket/comment_spec.rb

@@ -57,7 +57,7 @@ RSpec.describe ::Sequencer::Sequence::Import::Zendesk::Ticket::Comment, sequence
               'rel'  => nil
             },
           },
-          'created_at'  => '2015-07-19 22:41:44 UTC',
+          'created_at'  => '2018-09-28T12:00:00Z',
           'metadata'    => {
             'system' => {},
             'custom' => {}
@@ -85,9 +85,11 @@ RSpec.describe ::Sequencer::Sequence::Import::Zendesk::Ticket::Comment, sequence
 
     let(:imported_article) do
       {
-        from: 'john.doe@example.com',
-        to:   'zendesk@example.com',
-        body: "\n<div dir=\"auto\">\n<p dir=\"auto\">This is the latest comment for this ticket. You also changed the ticket status to Pending.</p>\n<span><img src=\"data:image/png;base64,MTIz\"></span>\n</div>\n"
+        from:       'john.doe@example.com',
+        to:         'zendesk@example.com',
+        body:       "\n<div dir=\"auto\">\n<p dir=\"auto\">This is the latest comment for this ticket. You also changed the ticket status to Pending.</p>\n<span><img src=\"data:image/png;base64,MTIz\"></span>\n</div>\n",
+        created_at: Time.zone.parse('2018-09-28T12:00:00Z'),
+        updated_at: Time.zone.parse('2018-09-28T12:00:00Z'),
       }
     end