trabajo-afectivo/spec/factories/channel.rb

69 lines
1.5 KiB
Ruby
Raw Normal View History

FactoryBot.define do
factory :channel do
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
factory :email_channel do
area 'Email::Account'
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
2018-12-13 09:06:44 +00:00
area 'Twitter::Account'
options do
{
adapter: 'twitter',
auth: {
consumer_key: 'some',
consumer_secret: 'some',
oauth_token: 'key',
2018-12-13 09:06:44 +00:00
oauth_token_secret: 'secret',
},
user: {
id: 'system_id',
2018-12-18 10:40:56 +00:00
screen_name: 'system_login',
2018-12-13 09:06:44 +00:00
},
sync: {
2018-12-13 09:06:44 +00:00
import_older_tweets: true,
track_retweets: true,
search: [
2018-12-13 09:06:44 +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
},
{
term: 'hash_tag1',
2018-12-18 10:40:56 +00:00
group_id: Group.first.id
}
2018-12-13 09:06:44 +00:00
],
mentions: {
2018-12-18 10:40:56 +00:00
group_id: Group.first.id
2018-12-13 09:06:44 +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
end
end