Story#110308584 - update tests of features/blocked and reserved domains

This commit is contained in:
Vladimir Krylov 2016-04-21 11:53:28 +03:00
parent 24fa4e93cc
commit f8702395af
2 changed files with 15 additions and 9 deletions

View file

@ -18,12 +18,15 @@ feature 'BlockedDomain', type: :feature do
d.valid?
d.errors.full_messages.should match_array([])
fill_in 'blocked_domains', with: "ftp.ee\ncache.ee"
domains = %w(ftp.ee cache.ee)
domains.each do |domain|
click_link "New"
fill_in 'Name', with: domain
click_button 'Save'
end
page.should have_content('Record updated')
page.should have_content('ftp.ee')
page.should have_content('cache.ee')
BlockedDomain.pluck(:name).should include(*domains)
d.valid?
d.errors.full_messages.should match_array(["Data management policy violation: Domain name is blocked [name]"])

View file

@ -18,11 +18,14 @@ feature 'ReservedDomain', type: :feature do
d.valid?
d.errors.full_messages.should match_array([])
fill_in 'reserved_domains', with: "110.ee: testpw"
click_link "New"
fill_in 'Name', with: "110.ee"
fill_in 'Password', with: "testpw"
click_button 'Save'
page.should have_content('Record updated')
page.should have_content('110.ee: testpw')
ReservedDomain.pluck(:name).should include("110.ee")
ReservedDomain.pw_for("110.ee").should == "testpw"
d.valid?.should == false
d.errors.full_messages.should match_array(
@ -39,6 +42,6 @@ feature 'ReservedDomain', type: :feature do
d.save
visit admin_reserved_domains_url
page.should have_content('110.ee')
page.should_not have_content('110.ee: testpw')
page.should_not have_content('testpw')
end
end