mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
Add blocked domains feature test #2564
This commit is contained in:
parent
0e3e9e5327
commit
a2e6603ecc
1 changed files with 30 additions and 0 deletions
30
spec/features/admin/blocked_domain_spec.rb
Normal file
30
spec/features/admin/blocked_domain_spec.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
require 'rails_helper'
|
||||
|
||||
feature 'BlockedDomain', type: :feature do
|
||||
before :all do
|
||||
@user = Fabricate(:admin_user)
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in @user
|
||||
end
|
||||
|
||||
it 'should manage blocked domains' do
|
||||
visit admin_blocked_domains_url
|
||||
page.should have_content('Blocked domains')
|
||||
|
||||
d = Fabricate.build(:domain, name: 'ftp.ee')
|
||||
d.valid?
|
||||
d.errors.full_messages.should match_array([])
|
||||
|
||||
fill_in 'blocked_domains', with: "ftp.ee\ncache.ee"
|
||||
click_button 'Save'
|
||||
|
||||
page.should have_content('Record updated')
|
||||
page.should have_content('ftp.ee')
|
||||
page.should have_content('cache.ee')
|
||||
|
||||
d.valid?
|
||||
d.errors.full_messages.should match_array(["Domain name Domain name is blocked"])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue