2018-04-24 13:26:09 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :channel do
|
2019-03-27 09:01:36 +00:00
|
|
|
area { 'Email::Dummy' }
|
|
|
|
group { ::Group.find(1) }
|
|
|
|
active { true }
|
|
|
|
options {}
|
|
|
|
preferences {}
|
|
|
|
updated_by_id { 1 }
|
|
|
|
created_by_id { 1 }
|
2018-12-13 09:06:44 +00:00
|
|
|
|
2019-01-15 13:11:57 +00:00
|
|
|
factory :email_channel do
|
2019-03-27 09:01:36 +00:00
|
|
|
area { 'Email::Account' }
|
2019-01-15 13:11:57 +00:00
|
|
|
options do
|
|
|
|
{
|
|
|
|
inbound: {
|
|
|
|
adapter: 'null', options: {}
|
|
|
|
},
|
|
|
|
outbound: {
|
|
|
|
adapter: 'sendmail'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-12-13 09:06:44 +00:00
|
|
|
factory :twitter_channel do
|
2018-12-18 10:40:56 +00:00
|
|
|
transient do
|
|
|
|
custom_options { {} }
|
|
|
|
end
|
|
|
|
|
2019-03-27 09:01:36 +00:00
|
|
|
area { 'Twitter::Account' }
|
2018-12-13 09:06:44 +00:00
|
|
|
options do
|
|
|
|
{
|
|
|
|
adapter: 'twitter',
|
2018-12-19 17:31:51 +00:00
|
|
|
auth: {
|
|
|
|
consumer_key: 'some',
|
|
|
|
consumer_secret: 'some',
|
|
|
|
oauth_token: 'key',
|
2018-12-13 09:06:44 +00:00
|
|
|
oauth_token_secret: 'secret',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
user: {
|
|
|
|
id: 'system_id',
|
2018-12-18 10:40:56 +00:00
|
|
|
screen_name: 'system_login',
|
2018-12-13 09:06:44 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
sync: {
|
2018-12-13 09:06:44 +00:00
|
|
|
import_older_tweets: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
track_retweets: true,
|
|
|
|
search: [
|
2018-12-13 09:06:44 +00:00
|
|
|
{
|
2018-12-19 17:31:51 +00:00
|
|
|
term: 'zammad',
|
2018-12-18 10:40:56 +00:00
|
|
|
group_id: Group.first.id
|
2018-12-13 09:06:44 +00:00
|
|
|
},
|
|
|
|
{
|
2018-12-19 17:31:51 +00:00
|
|
|
term: 'hash_tag1',
|
2018-12-18 10:40:56 +00:00
|
|
|
group_id: Group.first.id
|
|
|
|
}
|
2018-12-13 09:06:44 +00:00
|
|
|
],
|
2018-12-19 17:31:51 +00:00
|
|
|
mentions: {
|
2018-12-18 10:40:56 +00:00
|
|
|
group_id: Group.first.id
|
2018-12-13 09:06:44 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
direct_messages: {
|
2018-12-18 10:40:56 +00:00
|
|
|
group_id: Group.first.id
|
2018-12-13 09:06:44 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-18 10:40:56 +00:00
|
|
|
}.deep_merge(custom_options)
|
2018-12-13 09:06:44 +00:00
|
|
|
end
|
|
|
|
end
|
2018-04-24 13:26:09 +00:00
|
|
|
end
|
|
|
|
end
|