forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage for
AccountDeletionRequest
class (mastodon#31937)
- Loading branch information
1 parent
42f9f50
commit e3baa1c
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |