account_deletion_request_spec.rb 575 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe AccountDeletionRequest do
  4. describe 'Associations' do
  5. it { is_expected.to belong_to(:account).required }
  6. end
  7. describe '#due_at' do
  8. before { stub_const 'AccountDeletionRequest::DELAY_TO_DELETION', 1.day }
  9. it 'returns time from created at with delay added' do
  10. account_deletion_request = Fabricate :account_deletion_request, created_at: Date.current.at_midnight
  11. expect(account_deletion_request.due_at)
  12. .to be_within(0.1).of(Date.tomorrow.at_midnight)
  13. end
  14. end
  15. end