mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +02:00
parent
ad90ce1c04
commit
b8790cc925
2 changed files with 20 additions and 0 deletions
|
@ -699,6 +699,7 @@ class Domain < ActiveRecord::Base
|
||||||
|
|
||||||
def set_server_hold
|
def set_server_hold
|
||||||
statuses << DomainStatus::SERVER_HOLD
|
statuses << DomainStatus::SERVER_HOLD
|
||||||
|
self.on_hold_time = Time.current
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop: disable Metrics/CyclomaticComplexity
|
# rubocop: disable Metrics/CyclomaticComplexity
|
||||||
|
|
|
@ -926,3 +926,22 @@ describe Domain do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RSpec.describe Domain, db: false do
|
||||||
|
describe '#set_server_hold' do
|
||||||
|
let(:domain) { described_class.new }
|
||||||
|
|
||||||
|
before :example do
|
||||||
|
travel_to Time.zone.parse('05.07.2010')
|
||||||
|
domain.set_server_hold
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'sets corresponding status' do
|
||||||
|
expect(domain.statuses).to include(DomainStatus::SERVER_HOLD)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'sets :on_hold_time to now' do
|
||||||
|
expect(domain.on_hold_time).to eq(Time.zone.parse('05.07.2010'))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue