chore: Add message_echo listener for Facebook (#1192)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Channel::FacebookPage do
|
||||
before { create(:channel_facebook_page) }
|
||||
let(:channel) { create(:channel_facebook_page) }
|
||||
|
||||
it { is_expected.to validate_presence_of(:account_id) }
|
||||
# it { is_expected.to validate_uniqueness_of(:page_id).scoped_to(:account_id) }
|
||||
it { is_expected.to belong_to(:account) }
|
||||
it { is_expected.to have_one(:inbox).dependent(:destroy) }
|
||||
|
||||
it 'has a valid name' do
|
||||
expect(channel.name).to eq('Facebook')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -69,13 +69,17 @@ RSpec.describe Inbox do
|
||||
|
||||
it do
|
||||
expect(inbox.facebook?).to eq(true)
|
||||
expect(inbox.inbox_type).to eq('Facebook')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the channel type is not Channel::FacebookPage' do
|
||||
let(:channel_val) { Channel::WebWidget.new }
|
||||
|
||||
it { expect(inbox.facebook?).to eq(false) }
|
||||
it do
|
||||
expect(inbox.facebook?).to eq(false)
|
||||
expect(inbox.inbox_type).to eq('Website')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user