mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Merge branch 'master' into registry-790
# Conflicts: # app/models/domain_cron.rb # lib/tasks/dev.rake
This commit is contained in:
commit
5b821f4074
77 changed files with 278 additions and 496 deletions
|
@ -10,6 +10,7 @@ FactoryBot.define do
|
|||
email 'test@test.com'
|
||||
country_code 'US'
|
||||
accounting_customer_code 'test'
|
||||
language 'en'
|
||||
|
||||
factory :registrar_with_unlimited_balance do
|
||||
after :create do |registrar|
|
||||
|
|
|
@ -31,8 +31,6 @@ RSpec.feature 'Contact deletion in registrar area' do
|
|||
background do
|
||||
allow(Depp::Contact).to receive(:find_by_id).and_return(FakeDeppContact.new)
|
||||
allow(Depp::Contact).to receive(:new).and_return(FakeDeppContact.new)
|
||||
Setting.api_ip_whitelist_enabled = false
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
sign_in_to_registrar_area(user: create(:api_user_with_unlimited_balance, registrar: registrar))
|
||||
end
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Registrar area IP restriction', settings: false do
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
before do
|
||||
@original_registrar_ip_whitelist_enabled = Setting.registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
after do
|
||||
Setting.registrar_ip_whitelist_enabled = @original_registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
scenario 'notifies the user if his IP is not allowed' do
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
visit registrar_root_path
|
||||
expect(page).to have_text('Access denied from IP 127.0.0.1')
|
||||
end
|
||||
|
|
|
@ -6,7 +6,6 @@ RSpec.feature 'Registrar area linked users', settings: false do
|
|||
username: 'new-user-name') }
|
||||
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
sign_in_to_registrar_area(user: current_user)
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ require 'rails_helper'
|
|||
|
||||
RSpec.feature 'Registrar area profile', settings: false do
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
sign_in_to_registrar_area(user: create(:api_user_with_unlimited_balance))
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ RSpec.feature 'Mobile ID login', db: true do
|
|||
given!(:api_user) { create(:api_user, identity_code: 1234) }
|
||||
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
digidoc_client = instance_double(Digidoc::Client, authenticate: OpenStruct.new(user_id_code: 1234), session_code: 1234)
|
||||
allow(Digidoc::Client).to receive(:new).and_return(digidoc_client)
|
||||
end
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Registrar area password sign-in' do
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
end
|
||||
|
||||
scenario 'signs in the user with valid credentials' do
|
||||
create(:api_user_with_unlimited_balance,
|
||||
active: true,
|
||||
|
|
|
@ -2,7 +2,6 @@ require 'rails_helper'
|
|||
|
||||
RSpec.feature 'Registrar area sign-out', settings: false do
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
sign_in_to_registrar_area(user: create(:api_user_with_unlimited_balance))
|
||||
end
|
||||
|
||||
|
|
|
@ -2,6 +2,14 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe Authorization::RestrictedIP do
|
||||
describe '::enabled?', db: true, settings: false do
|
||||
before do
|
||||
@original_registrar_ip_whitelist_enabled = Setting.registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
after do
|
||||
Setting.registrar_ip_whitelist_enabled = @original_registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
context 'when "registrar_ip_whitelist_enabled" is true' do
|
||||
before do
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
|
@ -13,10 +21,6 @@ RSpec.describe Authorization::RestrictedIP do
|
|||
end
|
||||
|
||||
context 'when "registrar_ip_whitelist_enabled" is false' do
|
||||
before do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
end
|
||||
|
||||
specify do
|
||||
expect(described_class).to_not be_enabled
|
||||
end
|
||||
|
|
|
@ -108,30 +108,6 @@ RSpec.describe Domain do
|
|||
@domain.registrant_update_confirmable?('123').should == false
|
||||
end
|
||||
|
||||
it 'should not find any domain pendings to clean' do
|
||||
Domain.clean_expired_pendings.should == 0
|
||||
end
|
||||
|
||||
it 'should not find any domains with wrong pendings' do
|
||||
domain = create(:domain)
|
||||
domain.registrant_verification_asked!('frame-str', '1')
|
||||
domain.registrant_verification_asked_at = 30.days.ago
|
||||
domain.save
|
||||
|
||||
Domain.clean_expired_pendings.should == 0
|
||||
end
|
||||
|
||||
it 'should clean domain pendings' do
|
||||
domain = create(:domain)
|
||||
domain.registrant_verification_asked!('frame-str', '1')
|
||||
domain.registrant_verification_asked_at = 30.days.ago
|
||||
domain.pending_delete!
|
||||
|
||||
DomainCron.clean_expired_pendings.should == 1
|
||||
domain.reload.pending_delete?.should == false
|
||||
domain.pending_json.should == {}
|
||||
end
|
||||
|
||||
it 'should expire domains' do
|
||||
Setting.expire_warning_period = 1
|
||||
Setting.redemption_grace_period = 1
|
||||
|
@ -164,14 +140,6 @@ RSpec.describe Domain do
|
|||
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
|
||||
end
|
||||
|
||||
it 'should start redemption grace period' do
|
||||
domain = create(:domain)
|
||||
|
||||
DomainCron.start_redemption_grace_period
|
||||
domain.reload
|
||||
domain.statuses.include?(DomainStatus::SERVER_HOLD).should == false
|
||||
end
|
||||
|
||||
context 'with time period settings' do
|
||||
before :example do
|
||||
@save_days_to_renew = Setting.days_to_renew_domain_before_expire
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Registrar area IP restriction', settings: false do
|
||||
before do
|
||||
@original_registrar_ip_whitelist_enabled = Setting.registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
after do
|
||||
Setting.registrar_ip_whitelist_enabled = @original_registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
context 'when authenticated' do
|
||||
before do
|
||||
sign_in_to_registrar_area
|
||||
|
@ -39,10 +47,6 @@ RSpec.describe 'Registrar area IP restriction', settings: false do
|
|||
end
|
||||
|
||||
context 'when IP restriction is disabled' do
|
||||
before do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
end
|
||||
|
||||
specify do
|
||||
get registrar_root_url
|
||||
follow_redirect!
|
||||
|
@ -77,10 +81,6 @@ RSpec.describe 'Registrar area IP restriction', settings: false do
|
|||
end
|
||||
|
||||
context 'when IP restriction is disabled' do
|
||||
before do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
end
|
||||
|
||||
specify do
|
||||
get registrar_login_path
|
||||
expect(response).to be_success
|
||||
|
|
|
@ -3,10 +3,6 @@ require 'rails_helper'
|
|||
RSpec.describe 'Registrar area password sign-in', settings: false do
|
||||
let!(:user) { create(:api_user, active: true, login: 'test', password: 'testtest') }
|
||||
|
||||
before do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
end
|
||||
|
||||
it 'signs the user in' do
|
||||
post registrar_sessions_path, depp_user: { tag: 'test', password: 'testtest' }
|
||||
follow_redirect!
|
||||
|
|
|
@ -2,7 +2,6 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe 'Registrar area sign-out', settings: false do
|
||||
before do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
sign_in_to_registrar_area
|
||||
end
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe 'admin/billing/prices/_form' do
|
|||
allow(view).to receive(:durations).and_return([])
|
||||
end
|
||||
|
||||
stub_template '_form_errors' => ''
|
||||
stub_template '_form_errors.html.erb' => ''
|
||||
end
|
||||
|
||||
describe 'price' do
|
||||
|
|
|
@ -5,7 +5,7 @@ RSpec.describe 'admin/dns/zones/index' do
|
|||
|
||||
before :example do
|
||||
assign(:zones, zones)
|
||||
stub_template '_zone' => 'zone-row'
|
||||
stub_template '_zone.html.erb' => 'zone-row'
|
||||
end
|
||||
|
||||
it 'has title' do
|
||||
|
|
|
@ -13,8 +13,8 @@ RSpec.describe 'admin/domains/edit' do
|
|||
|
||||
assign(:domain, domain)
|
||||
|
||||
stub_template '_form' => ''
|
||||
stub_template '_force_delete_dialog' => ''
|
||||
stub_template '_form.html.erb' => ''
|
||||
stub_template '_force_delete_dialog.html.erb' => ''
|
||||
end
|
||||
|
||||
it 'has force_delete_toggle_btn' do
|
||||
|
|
|
@ -10,11 +10,11 @@ RSpec.describe 'registrar/contacts/_form' do
|
|||
|
||||
assign(:contact, contact)
|
||||
|
||||
stub_template 'registrar/shared/_error_messages' => ''
|
||||
stub_template 'registrar/contacts/form/_general' => ''
|
||||
stub_template 'registrar/contacts/form/_address' => 'address info'
|
||||
stub_template 'registrar/contacts/form/_code' => ''
|
||||
stub_template 'registrar/contacts/form/_legal_document' => ''
|
||||
stub_template 'registrar/shared/_error_messages.haml' => ''
|
||||
stub_template 'registrar/contacts/form/_general.html.haml' => ''
|
||||
stub_template 'registrar/contacts/form/_address.html.haml' => 'address info'
|
||||
stub_template 'registrar/contacts/form/_code.html.haml' => ''
|
||||
stub_template 'registrar/contacts/form/_legal_document.html.haml' => ''
|
||||
end
|
||||
|
||||
context 'when address processing is enabled' do
|
||||
|
|
|
@ -5,11 +5,11 @@ RSpec.describe 'registrar/contacts/show' do
|
|||
|
||||
before do
|
||||
assign(:contact, contact)
|
||||
stub_template 'shared/_title' => ''
|
||||
stub_template 'registrar/contacts/partials/_general' => ''
|
||||
stub_template 'registrar/contacts/partials/_statuses' => ''
|
||||
stub_template 'registrar/contacts/partials/_domains' => ''
|
||||
stub_template 'registrar/contacts/partials/_address' => 'address info'
|
||||
stub_template 'shared/_title.html.haml' => ''
|
||||
stub_template 'registrar/contacts/partials/_general.html.haml' => ''
|
||||
stub_template 'registrar/contacts/partials/_statuses.html.haml' => ''
|
||||
stub_template 'registrar/contacts/partials/_domains.html.haml' => ''
|
||||
stub_template 'registrar/contacts/partials/_address.html.haml' => 'address info'
|
||||
end
|
||||
|
||||
context 'when address processing is enabled' do
|
||||
|
|
|
@ -10,10 +10,10 @@ RSpec.describe 'registrar/domains/_form' do
|
|||
|
||||
assign(:domain, domain)
|
||||
|
||||
stub_template 'registrar/domains/form/_general' => ''
|
||||
stub_template 'registrar/domains/form/_contacts' => ''
|
||||
stub_template 'registrar/domains/form/_nameservers' => ''
|
||||
stub_template 'registrar/domains/form/_dnskeys' => ''
|
||||
stub_template 'registrar/domains/form/_general.html.haml' => ''
|
||||
stub_template 'registrar/domains/form/_contacts.html.haml' => ''
|
||||
stub_template 'registrar/domains/form/_nameservers.html.haml' => ''
|
||||
stub_template 'registrar/domains/form/_dnskeys.html.haml' => ''
|
||||
end
|
||||
|
||||
it 'has legal document' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue