Feature: Twitter DM Integration (#451)
An initial version of twitter integration Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
11
spec/factories/channel/twitter_profiles.rb
Normal file
11
spec/factories/channel/twitter_profiles.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :channel_twitter_profile, class: 'Channel::TwitterProfile' do
|
||||
name { Faker::Name.name }
|
||||
twitter_access_token { SecureRandom.uuid }
|
||||
twitter_access_token_secret { SecureRandom.uuid }
|
||||
profile_id { SecureRandom.uuid }
|
||||
account
|
||||
end
|
||||
end
|
||||
37
spec/factories/twitter/twitter_message_create_event.rb
Normal file
37
spec/factories/twitter/twitter_message_create_event.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :twitter_message_create_event, class: Hash do
|
||||
for_user_id { '1' }
|
||||
direct_message_events do
|
||||
[{
|
||||
'type' => 'message_create',
|
||||
'id' => '123',
|
||||
'message_create' => {
|
||||
target: { 'recipient_id' => '1' },
|
||||
'sender_id' => '2',
|
||||
'source_app_id' => '268278',
|
||||
'message_data' => {
|
||||
'text' => 'Blue Bird'
|
||||
}
|
||||
}
|
||||
}]
|
||||
end
|
||||
users do
|
||||
{
|
||||
'1' => {
|
||||
id: '1',
|
||||
name: 'person 1',
|
||||
profile_image_url: 'https://via.placeholder.com/250x250.png'
|
||||
},
|
||||
'2' => {
|
||||
id: '1',
|
||||
name: 'person 1',
|
||||
profile_image_url: 'https://via.placeholder.com/250x250.png'
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
initialize_with { attributes }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user