Add private method for event export filename (#38454)

This commit is contained in:
Matt Jankowski
2026-03-27 11:25:19 -04:00
committed by GitHub
parent ab5cbe3509
commit df9dec741f
3 changed files with 30 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
# frozen_string_literal: true
RSpec.describe AccountRelationshipSeveranceEvent do
describe 'Associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:relationship_severance_event) }
it { is_expected.to have_many(:severed_relationships).through(:relationship_severance_event) }
end
describe '#identifier' do
subject { account_relationship_severance_event.identifier }
let(:account_relationship_severance_event) { Fabricate.build :account_relationship_severance_event, relationship_severance_event:, created_at: DateTime.new(2026, 3, 15, 1, 2, 3) }
let(:relationship_severance_event) { Fabricate.build :relationship_severance_event, target_name: 'host.example' }
context 'with a hostname target and timestamp' do
it { is_expected.to eq('host.example-2026-03-15') }
end
end
end