diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/models/concerns/pg_full_text_searchable_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/models/concerns/pg_full_text_searchable_spec.rb')
-rw-r--r-- | spec/models/concerns/pg_full_text_searchable_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/concerns/pg_full_text_searchable_spec.rb b/spec/models/concerns/pg_full_text_searchable_spec.rb index db7f652f494..b6da481024a 100644 --- a/spec/models/concerns/pg_full_text_searchable_spec.rb +++ b/spec/models/concerns/pg_full_text_searchable_spec.rb @@ -54,12 +54,23 @@ RSpec.describe PgFullTextSearchable do end context 'when specified columns are not changed' do - it 'does not enqueue worker' do + it 'does not call update_search_data!' do expect(model).not_to receive(:update_search_data!) model.update!(description: 'A new description') end end + + context 'when model is updated twice within a transaction' do + it 'calls update_search_data!' do + expect(model).to receive(:update_search_data!) + + model.transaction do + model.update!(title: 'A new title') + model.update!(updated_at: Time.current) + end + end + end end describe '.pg_full_text_search' do |