Skip to content

Commit

Permalink
changing a test a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsujigiri committed Mar 31, 2012
1 parent 64f1f40 commit fa00177
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/unit/user_phenotype_test.rb
Expand Up @@ -5,21 +5,21 @@ class UserPhenotypeTest < ActiveSupport::TestCase
setup do
@phenotype = Factory :phenotype
@user_phenotype_0 = Factory :user_phenotype,
phenotype_id: @phenotype.id, variation: 'foo-bar'
phenotype_id: @phenotype.id, variation: 'male'
@user_phenotype_1 = Factory :user_phenotype,
phenotype_id: @phenotype.id, variation: 'Foo Bar'
phenotype_id: @phenotype.id, variation: 'female'
@user_phenotype_2 = Factory :user_phenotype,
phenotype_id: @phenotype.id + 1, variation: 'Foo Bar'
phenotype_id: @phenotype.id + 1, variation: 'male'
Sunspot.commit
end

should "find similar user phenotypes" do
phenotype = @phenotype
results = UserPhenotype.search do
with(:phenotype_id, phenotype.id)
fulltext 'foo bar'
fulltext 'male'
end.results
assert_equal [@user_phenotype_0, @user_phenotype_1], results.sort_by(&:id)
assert_equal [@user_phenotype_0], results.sort_by(&:id)
end
end
end

0 comments on commit fa00177

Please sign in to comment.