feat: Link help center portal to an Inbox (#6903)
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user