* fix broken tests

This commit is contained in:
Seth Call 2014-09-22 15:55:02 -05:00
parent 7645acac72
commit 51b5923022
2 changed files with 4 additions and 4 deletions

View File

@ -190,7 +190,7 @@ module JamRuby
my_locid = locidispid/1000000 # if the user didn't specify a location to search on, user their account locidispid
end
unless locidispid.nil?
if !locidispid.nil? && !user.nil?
# score_join of left allows for null scores, whereas score_join of inner requires a score however good or bad
# this is ANY_SCORE:
score_join = 'left outer' # or 'inner'
@ -267,7 +267,7 @@ module JamRuby
rel = rel.where(['connections.aasm_state != ?', 'expired'])
end
unless locidispid.nil?
if !locidispid.nil? && !user.nil?
rel = rel.order('nondirected_scores.full_score ASC NULLS LAST')
end

View File

@ -361,7 +361,7 @@ describe 'Musician search' do
end
context 'filter settings' do
it "searches musicisns for an instrument" do
it "searches musicians for an instrument" do
minst = FactoryGirl.create(:musician_instrument, {
:user => @user1,
:instrument => Instrument.find('tuba')})
@ -369,7 +369,7 @@ describe 'Musician search' do
@user1.reload
ii = @user1.instruments.detect { |inst| inst.id == 'tuba' }
expect(ii).to_not be_nil
results = Search.musician_filter({:instrument => ii.id, score_limit: Search::TEST_SCORE})
results = Search.musician_filter({:instrument => ii.id, score_limit: Search::TEST_SCORE}, @user2)
results.results.each do |rr|
expect(rr.instruments.detect { |inst| inst.id=='tuba' }.id).to eq(ii.id)
end