-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'rails_helper' | ||
require 'faker' | ||
require 'support/poltergeist_js_hack_for_login' | ||
require 'capybara/email/rspec' | ||
|
||
feature 'search using ransack' do | ||
|
||
before do | ||
@person_one = FactoryGirl.create(:person, postal_code: '60606', preferred_contact_method: 'SMS') | ||
end | ||
|
||
scenario 'with no parameters' do | ||
login_with_admin_user | ||
visit '/search/index_ransack' | ||
click_button 'Search' | ||
expect(page).to have_text('Showing 1 results of 1 total') | ||
end | ||
|
||
scenario 'with matching parameters' do | ||
login_with_admin_user | ||
visit '/search/index_ransack' | ||
fill_in 'q_postal_code_start', with: '606' | ||
click_button 'Search' | ||
expect(page).to have_text('Showing 1 results of 1 total') | ||
end | ||
|
||
scenario 'with no matching parameters' do | ||
login_with_admin_user | ||
visit '/search/index_ransack' | ||
fill_in 'q_postal_code_start', with: '901' | ||
click_button 'Search' | ||
expect(page).to have_text('There are no CUTGroup members that match your search') | ||
end | ||
|
||
# scenario 'export search results to csv' do | ||
# end | ||
end |