Add coverage for AccountDeletionRequest class (#31937)
				
					
				
			This commit is contained in:
		
							parent
							
								
									42f9f507b6
								
							
						
					
					
						commit
						e3baa1cdda
					
				
							
								
								
									
										19
									
								
								spec/models/account_deletion_request_spec.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								spec/models/account_deletion_request_spec.rb
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user