feat: Link help center portal to an Inbox (#6903)

This commit is contained in:
Tejaswini Chile
2023-04-24 12:49:52 +05:30
committed by GitHub
parent f825a22997
commit e3193dcabc
11 changed files with 77 additions and 3 deletions

View File

@@ -197,11 +197,19 @@ RSpec.describe Inbox do
describe '#update' do
let!(:inbox) { FactoryBot.create(:inbox) }
let!(:portal) { FactoryBot.create(:portal) }
before do
allow(Rails.configuration.dispatcher).to receive(:dispatch)
end
it 'set portal id in inbox' do
inbox.portal_id = portal.id
inbox.save
expect(inbox.portal).to eq(portal)
end
it 'resets cache key if there is an update in the channel' do
channel = inbox.channel
channel.update(widget_color: '#fff')

View File

@@ -14,6 +14,7 @@ RSpec.describe Portal, type: :model do
it { is_expected.to have_many(:articles) }
it { is_expected.to have_many(:portal_members) }
it { is_expected.to have_many(:members) }
it { is_expected.to have_many(:inboxes) }
end
describe 'validations' do