Improved test.

This commit is contained in:
Martin Edenhofer 2015-12-12 23:28:34 +01:00
parent e7f93ce103
commit ee87075b23
2 changed files with 3 additions and 3 deletions

View file

@ -97,9 +97,8 @@ class Tweet
Rails.logger.debug group_id.inspect
if tweet.class.to_s == 'Twitter::DirectMessage'
article = Ticket::Article.find_by(
from: 'me_bauer',
from: tweet.in_reply_to_screen_name,
type_id: Ticket::Article::Type.find_by( name: 'twitter direct-message' ).id,
)
@ -156,7 +155,7 @@ class Tweet
end
Ticket::Article.create(
from: user.login,
from: tweet.in_reply_to_screen_name,
to: to,
body: tweet.text,
message_id: tweet.id,

View file

@ -141,6 +141,7 @@ class TwitterTest < ActiveSupport::TestCase
article = Ticket::Article.find_by( message_id: tweet.id )
assert(article, "article tweet '#{tweet.id}' imported")
assert_equal('armin_theo', article.from, 'ticket article inbound from')
assert_equal(2, article.ticket.articles.count, 'ticket article inbound count')
assert_equal(reply_text.utf8_to_3bytesutf8, ticket.articles.last.body, 'ticket article inbound body')
end