mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 07:52:04 +02:00
Disallow EPP domain:update/transfer/delete if a domain has "deleteCandidate" status
#355
This commit is contained in:
parent
d4ddb5dc25
commit
edf1e33260
10 changed files with 193 additions and 2 deletions
19
spec/models/concerns/domain/deletable_spec.rb
Normal file
19
spec/models/concerns/domain/deletable_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
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]) }
|
||||
|
||||
specify { expect(domain).to be_discarded }
|
||||
end
|
||||
|
||||
context 'when :deleteCandidate status is absent' do
|
||||
let(:domain) { described_class.new(statuses: []) }
|
||||
|
||||
specify { expect(domain).to_not be_discarded }
|
||||
end
|
||||
end
|
||||
end
|
|
@ -607,7 +607,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(:outzone_time, :outzone_at) }
|
||||
|
||||
describe 'nameserver validation', db: true do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue