mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Add domain name search test #2122
This commit is contained in:
parent
9aa54a897e
commit
174d632bc9
4 changed files with 60 additions and 2 deletions
51
spec/features/admin/domain_spec.rb
Normal file
51
spec/features/admin/domain_spec.rb
Normal file
|
@ -0,0 +1,51 @@
|
|||
require 'rails_helper'
|
||||
|
||||
feature 'Domain', type: :feature do
|
||||
before :all do
|
||||
@user = Fabricate(:admin_user)
|
||||
end
|
||||
|
||||
it 'should show index of domains' do
|
||||
Fabricate(:domain, name: 'testing.ee')
|
||||
sign_in @user
|
||||
visit admin_domains_url
|
||||
|
||||
page.should have_content('testing.ee')
|
||||
end
|
||||
|
||||
it 'should search domains by name' do
|
||||
d1 = Fabricate(:domain, name: 'abcde.ee')
|
||||
Fabricate(:domain, name: 'abcdee.ee')
|
||||
Fabricate(:domain, name: 'defgh.pri.ee')
|
||||
sign_in @user
|
||||
visit admin_domains_url
|
||||
|
||||
page.should have_content('abcde.ee')
|
||||
page.should have_content('abcdee.ee')
|
||||
page.should have_content('defgh.pri.ee')
|
||||
|
||||
fill_in 'q_name_matches', with: 'abcde.ee'
|
||||
find('.btn.btn-primary').click
|
||||
|
||||
current_path.should == "/admin/domains/#{d1.id}"
|
||||
|
||||
visit admin_domains_url
|
||||
fill_in 'q_name_matches', with: '.ee'
|
||||
find('.btn.btn-primary').click
|
||||
|
||||
current_path.should == "/admin/domains"
|
||||
page.should have_content('abcde.ee')
|
||||
page.should have_content('abcdee.ee')
|
||||
page.should have_content('defgh.pri.ee')
|
||||
|
||||
fill_in 'q_name_matches', with: 'abcd%.ee'
|
||||
find('.btn.btn-primary').click
|
||||
page.should have_content('abcde.ee')
|
||||
page.should have_content('abcdee.ee')
|
||||
page.should_not have_content('defgh.pri.ee')
|
||||
|
||||
fill_in 'q_name_matches', with: 'abcd_.ee'
|
||||
find('.btn.btn-primary').click
|
||||
current_path.should == "/admin/domains/#{d1.id}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue