Skip to content

Commit

Permalink
basic ransack search spec
Browse files Browse the repository at this point in the history
  • Loading branch information
shua123 committed Sep 14, 2016
1 parent 6e18de6 commit 65c3f7d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions spec/features/search_ransack_spec.rb
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

0 comments on commit 65c3f7d

Please sign in to comment.