* Add: #581 NGワード検出履歴を定期的に削除する処理 * マイグレーションコードを修正
This commit is contained in:
parent
aec832e257
commit
b2acc7dbb8
6 changed files with 26 additions and 1 deletions
|
@ -6,6 +6,8 @@ RSpec.describe Vacuum::NgHistoriesVacuum do
|
|||
subject { described_class.new }
|
||||
|
||||
describe '#perform' do
|
||||
let!(:word_history_old) { Fabricate(:ngword_history, created_at: 30.days.ago) }
|
||||
let!(:word_history_recent) { Fabricate(:ngword_history, created_at: 2.days.ago) }
|
||||
let!(:rule_history_old) { Fabricate(:ng_rule_history, created_at: 30.days.ago) }
|
||||
let!(:rule_history_recent) { Fabricate(:ng_rule_history, created_at: 2.days.ago) }
|
||||
|
||||
|
@ -14,10 +16,12 @@ RSpec.describe Vacuum::NgHistoriesVacuum do
|
|||
end
|
||||
|
||||
it 'deletes old history' do
|
||||
expect { word_history_old.reload }.to raise_error ActiveRecord::RecordNotFound
|
||||
expect { rule_history_old.reload }.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
it 'does not delete recent history' do
|
||||
expect { word_history_recent.reload }.to_not raise_error
|
||||
expect { rule_history_recent.reload }.to_not raise_error
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue