mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
Add some tests for domain transfer
This commit is contained in:
parent
b48b91878d
commit
72a37f3b08
14 changed files with 120 additions and 39 deletions
52
spec/features/domain_transfer_spec.rb
Normal file
52
spec/features/domain_transfer_spec.rb
Normal file
|
@ -0,0 +1,52 @@
|
|||
require 'rails_helper'
|
||||
|
||||
feature 'Domain transfer', type: :feature do
|
||||
let(:elkdata) { Fabricate(:registrar, { name: 'Elkdata', reg_no: '123' }) }
|
||||
let(:zone) { Fabricate(:registrar) }
|
||||
let(:zone_user) { Fabricate(:user, registrar: zone, username: 'zone', admin: false) }
|
||||
let(:elkdata_user) { Fabricate(:user, registrar: elkdata, username: 'elkdata', admin: false) }
|
||||
|
||||
background do
|
||||
Fabricate(:domain_validation_setting_group)
|
||||
Fabricate(:domain_general_setting_group)
|
||||
Fabricate(:domain, registrar: zone)
|
||||
end
|
||||
|
||||
scenario 'when registrar requests transfer on own domain', js: true do
|
||||
sign_in zone_user
|
||||
click_on 'Domains'
|
||||
click_on 'Transfer domain'
|
||||
|
||||
fill_in 'Domain name', with: 'false'
|
||||
click_on 'Request domain transfer'
|
||||
expect(page).to have_text('Domain was not found!')
|
||||
|
||||
d = Domain.first
|
||||
fill_in 'Domain name', with: d.name
|
||||
click_on 'Request domain transfer'
|
||||
expect(page).to have_text('Password invalid!')
|
||||
|
||||
fill_in 'Domain password', with: d.auth_info
|
||||
click_on 'Request domain transfer'
|
||||
|
||||
expect(page).to have_text('Domain already belongs to the querying registrar')
|
||||
end
|
||||
|
||||
scenario 'when other registrar requests transfer' do
|
||||
sign_in elkdata_user
|
||||
d = Domain.first
|
||||
visit client_domains_path
|
||||
expect(page).to_not have_link(d.name)
|
||||
|
||||
visit new_client_domain_transfer_path
|
||||
fill_in 'Domain name', with: d.name
|
||||
fill_in 'Domain password', with: d.auth_info
|
||||
click_on 'Request domain transfer'
|
||||
|
||||
expect(page).to have_text('Domain transfer approved!')
|
||||
expect(page).to have_text('serverApproved')
|
||||
|
||||
visit client_domains_path
|
||||
expect(page).to have_link(d.name)
|
||||
end
|
||||
end
|
|
@ -20,9 +20,6 @@ Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
|||
ActiveRecord::Migration.maintain_test_schema!
|
||||
|
||||
RSpec.configure do |config|
|
||||
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
||||
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
||||
|
||||
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
||||
# examples within a transaction, remove the following line or assign false
|
||||
# instead of true.
|
||||
|
|
12
spec/support/feature.rb
Normal file
12
spec/support/feature.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module Feature
|
||||
def sign_in(user)
|
||||
visit root_path
|
||||
click_on 'ID card (gitlab)' if user.username == 'gitlab'
|
||||
click_on 'ID card (zone)' if user.username == 'zone'
|
||||
click_on 'ID card (elkdata)' if user.username == 'elkdata'
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |c|
|
||||
c.include Feature, type: :feature
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue