* Wip * Wip * Wip: History * Wip: テストコード作成 * Fix test * Wip * Wip * Wip * Fix test * Wip * Wip * Wip * Wip * なんとか完成、これから動作確認 * spell miss * Change ng rule timings * Fix test * Wip * Fix test * Wip * Fix form * 表示まわりの改善
This commit is contained in:
parent
0779c748a6
commit
7d96d5828e
56 changed files with 2062 additions and 42 deletions
24
spec/lib/vacuum/ng_histories_vacuum_spec.rb
Normal file
24
spec/lib/vacuum/ng_histories_vacuum_spec.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Vacuum::NgHistoriesVacuum do
|
||||
subject { described_class.new }
|
||||
|
||||
describe '#perform' do
|
||||
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) }
|
||||
|
||||
before do
|
||||
subject.perform
|
||||
end
|
||||
|
||||
it 'deletes old history' do
|
||||
expect { rule_history_old.reload }.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
it 'does not delete recent history' do
|
||||
expect { rule_history_recent.reload }.to_not raise_error
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue