mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Refactor zones
- Rename "zonefile_setting" to "zone" - Remove version #475
This commit is contained in:
parent
f1d7e53734
commit
bff7437277
51 changed files with 425 additions and 389 deletions
16
spec/features/admin/dns/zones/delete_spec.rb
Normal file
16
spec/features/admin/dns/zones/delete_spec.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Deleting zone in admin area' do
|
||||
given!(:zone) { create(:zone) }
|
||||
|
||||
background do
|
||||
sign_in_to_admin_area
|
||||
end
|
||||
|
||||
scenario 'deletes zone' do
|
||||
visit edit_admin_zone_url(zone)
|
||||
click_link_or_button t('admin.dns.zones.edit.delete_btn')
|
||||
|
||||
expect(page).to have_text(t('admin.dns.zones.destroy.destroyed'))
|
||||
end
|
||||
end
|
29
spec/features/admin/dns/zones/edit_spec.rb
Normal file
29
spec/features/admin/dns/zones/edit_spec.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Editing zone in admin area' do
|
||||
given!(:zone) { create(:zone) }
|
||||
|
||||
background do
|
||||
sign_in_to_admin_area
|
||||
end
|
||||
|
||||
scenario 'updates zone' do
|
||||
open_list
|
||||
open_form
|
||||
submit_form
|
||||
|
||||
expect(page).to have_text(t('admin.dns.zones.update.updated'))
|
||||
end
|
||||
|
||||
def open_list
|
||||
click_link_or_button t('admin.menu.zones')
|
||||
end
|
||||
|
||||
def open_form
|
||||
click_link_or_button t('admin.dns.zones.zone.edit_btn')
|
||||
end
|
||||
|
||||
def submit_form
|
||||
click_link_or_button t('admin.dns.zones.form.update_btn')
|
||||
end
|
||||
end
|
39
spec/features/admin/dns/zones/new_spec.rb
Normal file
39
spec/features/admin/dns/zones/new_spec.rb
Normal file
|
@ -0,0 +1,39 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'New zone in admin area' do
|
||||
background do
|
||||
sign_in_to_admin_area
|
||||
end
|
||||
|
||||
scenario 'it creates new zone' do
|
||||
open_list
|
||||
open_form
|
||||
fill_form
|
||||
submit_form
|
||||
|
||||
expect(page).to have_text(t('admin.dns.zones.create.created'))
|
||||
end
|
||||
|
||||
def open_list
|
||||
click_link_or_button t('admin.menu.zones')
|
||||
end
|
||||
|
||||
def open_form
|
||||
click_link_or_button t('admin.dns.zones.index.new_btn')
|
||||
end
|
||||
|
||||
def fill_form
|
||||
fill_in 'zone_origin', with: 'test'
|
||||
fill_in 'zone_ttl', with: '1'
|
||||
fill_in 'zone_refresh', with: '1'
|
||||
fill_in 'zone_retry', with: '1'
|
||||
fill_in 'zone_expire', with: '1'
|
||||
fill_in 'zone_minimum_ttl', with: '1'
|
||||
fill_in 'zone_email', with: 'test@test.com'
|
||||
fill_in 'zone_master_nameserver', with: 'test.test'
|
||||
end
|
||||
|
||||
def submit_form
|
||||
click_link_or_button t('admin.dns.zones.form.create_btn')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue