Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'test_helper'
- class SimplePluginTest < ActiveSupport::TestCase
- def test_we_can_search_by_some_keywords
- person = Person.create :name => "Aaron Godin", :city => "Eau Claire"
- people = Person.search_by_fields "aaron", :name
- assert people.include?(person)
- end
- def test_we_can_search_by_multiple_fields_with_many_people
- person = Person.create :name => "Aaron Godin", :city => "Eau Claire"
- person2 = Person.create :name => "Claire Johnson", :city => "Madison"
- people = Person.search_by_fields "claire", :name, :city
- assert people.include?(person)
- assert people.include?(person2)
- end
- end
Add Comment
Please, Sign In to add comment