mirror of
https://github.com/internetee/registry.git
synced 2025-05-21 03:39:40 +02:00
Add contact search test #2866
This commit is contained in:
parent
e8a4706e73
commit
5efdd47f62
1 changed files with 35 additions and 0 deletions
|
@ -22,4 +22,39 @@ feature 'Admin contact', type: :feature do
|
||||||
# indivitually running it's created by autotest
|
# indivitually running it's created by autotest
|
||||||
page.should have_content(/by [unknown|autotest]/)
|
page.should have_content(/by [unknown|autotest]/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should search contacts by name' do
|
||||||
|
d1 = Fabricate(:contact, name: 'first name')
|
||||||
|
Fabricate(:contact, name: 'second name')
|
||||||
|
Fabricate(:contact, name: 'third name')
|
||||||
|
sign_in @user
|
||||||
|
visit admin_contacts_url
|
||||||
|
|
||||||
|
page.should have_content('first name')
|
||||||
|
page.should have_content('second name')
|
||||||
|
page.should have_content('third name')
|
||||||
|
|
||||||
|
fill_in 'q_name_matches', with: 'first name'
|
||||||
|
find('.btn.btn-primary').click
|
||||||
|
|
||||||
|
current_path.should == "/admin/contacts"
|
||||||
|
|
||||||
|
page.should have_content('first name')
|
||||||
|
page.should_not have_content('second name')
|
||||||
|
page.should_not have_content('third name')
|
||||||
|
|
||||||
|
fill_in 'q_name_matches', with: '%name'
|
||||||
|
find('.btn.btn-primary').click
|
||||||
|
|
||||||
|
page.should have_content('first name')
|
||||||
|
page.should have_content('second name')
|
||||||
|
page.should have_content('third name')
|
||||||
|
|
||||||
|
fill_in 'q_name_matches', with: 'sec___ name'
|
||||||
|
find('.btn.btn-primary').click
|
||||||
|
|
||||||
|
page.should_not have_content('first name')
|
||||||
|
page.should have_content('second name')
|
||||||
|
page.should_not have_content('third name')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue