Skip to content

Commit

Permalink
Add coverage for AccountDeletionRequest class (mastodon#31937)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored Sep 18, 2024
1 parent 42f9f50 commit e3baa1c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/models/account_deletion_request_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe AccountDeletionRequest do
describe 'Associations' do
it { is_expected.to belong_to(:account).required }
end

describe '#due_at' do
before { stub_const 'AccountDeletionRequest::DELAY_TO_DELETION', 1.day }

it 'returns time from created at with delay added' do
account_deletion_request = Fabricate :account_deletion_request, created_at: Date.current.at_midnight
expect(account_deletion_request.due_at)
.to be_within(0.1).of(Date.tomorrow.at_midnight)
end
end
end

0 comments on commit e3baa1c

Please sign in to comment.