feat: Added the ability to create Instagram channel (#11182)
This PR is part of https://github.com/chatwoot/chatwoot/pull/11054 to make the review cycle easier.
This commit is contained in:
@@ -6,6 +6,21 @@ FactoryBot.define do
|
||||
expires_at { 60.days.from_now }
|
||||
updated_at { 25.hours.ago }
|
||||
|
||||
before :create do |channel|
|
||||
WebMock::API.stub_request(:post, "https://graph.instagram.com/v22.0/#{channel.instagram_id}/subscribed_apps")
|
||||
.with(query: {
|
||||
access_token: channel.access_token,
|
||||
subscribed_fields: %w[messages message_reactions messaging_seen]
|
||||
})
|
||||
.to_return(status: 200, body: '', headers: {})
|
||||
|
||||
WebMock::API.stub_request(:delete, "https://graph.instagram.com/v22.0/#{channel.instagram_id}/subscribed_apps")
|
||||
.with(query: {
|
||||
access_token: channel.access_token
|
||||
})
|
||||
.to_return(status: 200, body: '', headers: {})
|
||||
end
|
||||
|
||||
after(:create) do |channel|
|
||||
create(:inbox, channel: channel, account: channel.account)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user