Fixes #3633 - The rebuild of the index is failing.
This commit is contained in:
parent
548ab91398
commit
5af09d73c7
2 changed files with 8 additions and 3 deletions
|
@ -27,7 +27,7 @@ returns
|
||||||
messages.each do |message|
|
messages.each do |message|
|
||||||
|
|
||||||
# lookup attributes of ref. objects (normally name and note)
|
# lookup attributes of ref. objects (normally name and note)
|
||||||
message_attributes = message.search_index_attribute_lookup
|
message_attributes = message.search_index_attribute_lookup(include_references: false)
|
||||||
|
|
||||||
attributes['messages'].push message_attributes
|
attributes['messages'].push message_attributes
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,11 +7,17 @@ RSpec.describe Chat::Session, type: :model do
|
||||||
describe '.search_index_attribute_lookup' do
|
describe '.search_index_attribute_lookup' do
|
||||||
subject(:chat_session) { create(:'chat/session', user: chat_user, chat: chat) }
|
subject(:chat_session) { create(:'chat/session', user: chat_user, chat: chat) }
|
||||||
|
|
||||||
|
let(:chat_message) { create(:'chat/message', chat_session: chat_session) }
|
||||||
|
|
||||||
let(:chat) { create(:chat) }
|
let(:chat) { create(:chat) }
|
||||||
let(:chat_user) { create(:agent) }
|
let(:chat_user) { create(:agent) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
chat_message
|
||||||
|
end
|
||||||
|
|
||||||
it 'verify message attribute' do
|
it 'verify message attribute' do
|
||||||
expect(chat_session.search_index_attribute_lookup['messages']).to eq []
|
expect(chat_session.search_index_attribute_lookup['messages']).not_to eq []
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'verify user attribute' do
|
it 'verify user attribute' do
|
||||||
|
@ -21,6 +27,5 @@ RSpec.describe Chat::Session, type: :model do
|
||||||
it 'verify chat attribute' do
|
it 'verify chat attribute' do
|
||||||
expect(chat_session.search_index_attribute_lookup['chat']['name']).to eq chat.name
|
expect(chat_session.search_index_attribute_lookup['chat']['name']).to eq chat.name
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue