diff options
Diffstat (limited to 'spec/models/error_tracking/project_error_tracking_setting_spec.rb')
-rw-r--r-- | spec/models/error_tracking/project_error_tracking_setting_spec.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/models/error_tracking/project_error_tracking_setting_spec.rb b/spec/models/error_tracking/project_error_tracking_setting_spec.rb index e81480ab88f..ef3679da71f 100644 --- a/spec/models/error_tracking/project_error_tracking_setting_spec.rb +++ b/spec/models/error_tracking/project_error_tracking_setting_spec.rb @@ -8,7 +8,7 @@ describe ErrorTracking::ProjectErrorTrackingSetting do let_it_be(:project) { create(:project) } - subject { create(:project_error_tracking_setting, project: project) } + subject(:setting) { create(:project_error_tracking_setting, project: project) } describe 'Associations' do it { is_expected.to belong_to(:project) } @@ -453,4 +453,23 @@ describe ErrorTracking::ProjectErrorTrackingSetting do end end end + + describe '#expire_issues_cache', :use_clean_rails_redis_caching do + let(:issues) { [:some, :issues] } + let(:opt) { 'list_issues' } + let(:params) { { issue_status: 'unresolved', limit: 20, sort: 'last_seen' } } + + before do + start_reactive_cache_lifetime(subject, opt, params.stringify_keys) + stub_reactive_cache(subject, issues, opt, params.stringify_keys) + end + + it 'clears the cache' do + expect(subject.list_sentry_issues(params)).to eq(issues) + + subject.expire_issues_cache + + expect(subject.list_sentry_issues(params)).to eq(nil) + end + end end |