diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-06-26 13:41:15 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-26 13:41:15 +0300 |
commit | 065859444939349634fca7c30853b68b9fae9275 (patch) | |
tree | 1dba91a53cf6d9d6915af7d49ee039bdf75d7ac4 /spec | |
parent | 565274aab2a496403c40626a386f86c02d742b23 (diff) | |
parent | d4c87d4dd7a1d7e4d9b38d37b16c85f7326321fc (diff) |
Merge branch 'sh-service-template-bug' into 'master'
Disable Rails SQL query cache when applying service templates
Closes #63595
See merge request gitlab-org/gitlab-ce!30060
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/projects/propagate_service_template_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/spec/services/projects/propagate_service_template_spec.rb b/spec/services/projects/propagate_service_template_spec.rb index f93e5aae82a..2c3effec617 100644 --- a/spec/services/projects/propagate_service_template_spec.rb +++ b/spec/services/projects/propagate_service_template_spec.rb @@ -72,7 +72,7 @@ describe Projects::PropagateServiceTemplate do expect(project.pushover_service.properties).to eq(service_template.properties) end - describe 'bulk update' do + describe 'bulk update', :use_sql_query_cache do let(:project_total) { 5 } before do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 390a869d93f..3bd2408dc72 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -218,6 +218,12 @@ RSpec.configure do |config| ActionController::Base.cache_store = caching_store end + config.around(:each, :use_sql_query_cache) do |example| + ActiveRecord::Base.cache do + example.run + end + end + # The :each scope runs "inside" the example, so this hook ensures the DB is in the # correct state before any examples' before hooks are called. This prevents a # problem where `ScheduleIssuesClosedAtTypeChange` (or any migration that depends |