mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
Extract domain's "delete_time" attribute to deletable concern
This commit is contained in:
parent
7d1a5558b0
commit
5f77c63332
3 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
|||
module Concerns::Domain::Deletable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
alias_attribute :delete_time, :delete_at
|
||||
end
|
||||
|
||||
def discarded?
|
||||
statuses.include?(DomainStatus::DELETE_CANDIDATE)
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Domain, db: false do
|
||||
it { is_expected.to alias_attribute(:delete_time, :delete_at) }
|
||||
|
||||
describe '#discarded?' do
|
||||
context 'when :deleteCandidate status is present' do
|
||||
let(:domain) { described_class.new(statuses: [DomainStatus::DELETE_CANDIDATE]) }
|
||||
|
|
|
@ -699,7 +699,6 @@ end
|
|||
|
||||
RSpec.describe Domain, db: false do
|
||||
it { is_expected.to alias_attribute(:on_hold_time, :outzone_at) }
|
||||
it { is_expected.to alias_attribute(:delete_time, :delete_at) }
|
||||
it { is_expected.to alias_attribute(:force_delete_time, :force_delete_at) }
|
||||
it { is_expected.to alias_attribute(:outzone_time, :outzone_at) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue