diff --git a/spec/models/conversation_spec.rb b/spec/models/conversation_spec.rb index 514fb80c5..f4208081d 100644 --- a/spec/models/conversation_spec.rb +++ b/spec/models/conversation_spec.rb @@ -243,6 +243,13 @@ RSpec.describe Conversation, type: :model do expect(conversation.label_list).to match_array(labels) end + it 'ensures preloaded labels are always in sync with the database' do + labels = [first_label, fourth_label].map(&:title) + expect(conversation.update_labels(labels)).to be(true) + expect(conversation.label_list).to match_array(labels) + expect(conversation.preloaded_label_list).to match_array(labels) + end + it 'adds and removes previously added labels' do labels = [first_label, fourth_label].map(&:title) expect { conversation.update_labels(labels) }