Add blocked domains feature test #2564

This commit is contained in:
Martin Lensment 2015-07-01 13:16:43 +03:00
parent 0e3e9e5327
commit a2e6603ecc

View 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