mirror of
https://github.com/internetee/registry.git
synced 2025-08-13 13:09:32 +02:00
Story#110308584 - update tests of features/blocked and reserved domains
This commit is contained in:
parent
24fa4e93cc
commit
f8702395af
2 changed files with 15 additions and 9 deletions
|
@ -18,12 +18,15 @@ feature 'BlockedDomain', type: :feature do
|
||||||
d.valid?
|
d.valid?
|
||||||
d.errors.full_messages.should match_array([])
|
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'
|
click_button 'Save'
|
||||||
|
end
|
||||||
|
|
||||||
page.should have_content('Record updated')
|
|
||||||
page.should have_content('ftp.ee')
|
BlockedDomain.pluck(:name).should include(*domains)
|
||||||
page.should have_content('cache.ee')
|
|
||||||
|
|
||||||
d.valid?
|
d.valid?
|
||||||
d.errors.full_messages.should match_array(["Data management policy violation: Domain name is blocked [name]"])
|
d.errors.full_messages.should match_array(["Data management policy violation: Domain name is blocked [name]"])
|
||||||
|
|
|
@ -18,11 +18,14 @@ feature 'ReservedDomain', type: :feature do
|
||||||
d.valid?
|
d.valid?
|
||||||
d.errors.full_messages.should match_array([])
|
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'
|
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.valid?.should == false
|
||||||
d.errors.full_messages.should match_array(
|
d.errors.full_messages.should match_array(
|
||||||
|
@ -39,6 +42,6 @@ feature 'ReservedDomain', type: :feature do
|
||||||
d.save
|
d.save
|
||||||
visit admin_reserved_domains_url
|
visit admin_reserved_domains_url
|
||||||
page.should have_content('110.ee')
|
page.should have_content('110.ee')
|
||||||
page.should_not have_content('110.ee: testpw')
|
page.should_not have_content('testpw')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue