Guest User

Untitled

a guest
Jan 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. require 'test_helper'
  2.  
  3. class SimplePluginTest < ActiveSupport::TestCase
  4. def test_we_can_search_by_some_keywords
  5. person = Person.create :name => "Aaron Godin", :city => "Eau Claire"
  6.  
  7. people = Person.search_by_fields "aaron", :name
  8. assert people.include?(person)
  9. end
  10.  
  11. def test_we_can_search_by_multiple_fields_with_many_people
  12. person = Person.create :name => "Aaron Godin", :city => "Eau Claire"
  13. person2 = Person.create :name => "Claire Johnson", :city => "Madison"
  14.  
  15. people = Person.search_by_fields "claire", :name, :city
  16. assert people.include?(person)
  17. assert people.include?(person2)
  18. end
  19. end
Add Comment
Please, Sign In to add comment