* fixing ruby tests and trying to harvest up db deb's better

This commit is contained in:
Seth Call 2015-07-15 11:25:58 -05:00
parent 3b71931e73
commit 393696a0f8
8 changed files with 18 additions and 20 deletions

View File

@ -16,3 +16,6 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
pg_migrate (= 0.1.13) pg_migrate (= 0.1.13)
BUNDLED WITH
1.10.3

View File

@ -31,6 +31,7 @@ if [ ! -z "$PACKAGE" ]; then
bundle install --path target/vendor/bundle bundle install --path target/vendor/bundle
pushd target pushd target
fpm -s gem -t deb ruby_package/jam_db-$VERSION.gem fpm -s gem -t deb ruby_package/jam_db-$VERSION.gem
find vendor/bundle/ruby/2.2.0/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb
find vendor/bundle/ruby/2.0.0/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb find vendor/bundle/ruby/2.0.0/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb
popd popd
fi fi

View File

@ -1 +1 @@
{"container_file": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20150706-18103-9lb217/jam-track-45.jkz", "version": "0", "coverart": null, "rsa_priv_file": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20150706-18103-9lb217/skey.pem", "tracks": [{"name": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20150706-18103-9lb217/4630741c-69a1-4bc6-8a9f-ec70cb5cd401.ogg", "trackName": "track_00"}], "rsa_pub_file": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20150706-18103-9lb217/pkey.pem", "jamktrack_info": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/tmpmwZtC7"} {"container_file": "/var/folders/05/1jpzfcln1hq9p666whnd7chr0000gn/T/d20150715-88934-1dmx4e8/jam-track-71.jkz", "version": "0", "coverart": null, "rsa_priv_file": "/var/folders/05/1jpzfcln1hq9p666whnd7chr0000gn/T/d20150715-88934-1dmx4e8/skey.pem", "tracks": [{"name": "/var/folders/05/1jpzfcln1hq9p666whnd7chr0000gn/T/d20150715-88934-1dmx4e8/8d7bb782-6c21-4809-9f6f-1f55225b0ba3.ogg", "trackName": "track_00"}], "rsa_pub_file": "/var/folders/05/1jpzfcln1hq9p666whnd7chr0000gn/T/d20150715-88934-1dmx4e8/pkey.pem", "jamktrack_info": "/var/folders/05/1jpzfcln1hq9p666whnd7chr0000gn/T/tmp1PmIe2"}

View File

@ -200,7 +200,7 @@ SELECT
tmp_candidate_sessions.creator_score_idx AS creator_score_idx tmp_candidate_sessions.creator_score_idx AS creator_score_idx
INTO TEMP TABLE tmp_candidate_recipients INTO TEMP TABLE tmp_candidate_recipients
FROM users FROM users
INNER JOIN musicians_instruments AS mi ON mi.user_id = users.id INNER JOIN musicians_instruments AS mi ON mi.player_id = users.id
INNER JOIN tmp_candidate_sessions ON tmp_candidate_sessions.is_unstructured_rsvp = TRUE OR INNER JOIN tmp_candidate_sessions ON tmp_candidate_sessions.is_unstructured_rsvp = TRUE OR
(tmp_candidate_sessions.open_rsvps = TRUE AND tmp_candidate_sessions.instrument_id = mi.instrument_id) OR (tmp_candidate_sessions.open_rsvps = TRUE AND tmp_candidate_sessions.instrument_id = mi.instrument_id) OR
tmp_candidate_sessions.invited_user_id = users.id tmp_candidate_sessions.invited_user_id = users.id

View File

@ -3,7 +3,6 @@ require 'spec_helper'
describe 'Band search' do describe 'Band search' do
before(:each) do before(:each) do
Band.delete_all
@bands = [] @bands = []
@bands << @band1 = FactoryGirl.create(:band) @bands << @band1 = FactoryGirl.create(:band)
@bands << @band2 = FactoryGirl.create(:band) @bands << @band2 = FactoryGirl.create(:band)

View File

@ -91,13 +91,6 @@ describe Band do
band.band_type.should == "virtual" band.band_type.should == "virtual"
band.band_status.should == "amateur" band.band_status.should == "amateur"
band.concert_count.should == 3 band.concert_count.should == 3
parms[:hourly_rate]="foobar"
parms[:gig_minimum]="barfoo"
band=Band.save(user, parms)
band.errors.any?.should be_true
band.errors[:hourly_rate].should == ["is not a number"]
band.errors[:gig_minimum].should == ["is not a number"]
end end

View File

@ -42,8 +42,10 @@ describe BroadcastNotification do
bns = BroadcastNotification.viewable_notifications(user1) bns = BroadcastNotification.viewable_notifications(user1)
expect(bns.count).to be(3) expect(bns.count).to be(3)
expect(bns[0].id).to eq(broadcast3.id) expect(bns[0].id).to eq(broadcast4.id)
expect(bns.detect {|bb| bb.id==broadcast2.id }).to be_nil expect(bns.detect {|bb| bb.id==broadcast2.id }).to be_nil
# now view broadcast 4, since it hasn't been seen, which should bring broadcast 3 up as next since it was seen longest ago
broadcast4.did_view(user1)
expect(BroadcastNotification.next_broadcast(user1).id).to eq(broadcast3.id) expect(BroadcastNotification.next_broadcast(user1).id).to eq(broadcast3.id)
end end

View File

@ -169,8 +169,8 @@ describe 'Musician Search Model' do
end end
it "gets expected number of users" do it "gets expected number of users" do
instjson = [{ instrument_id: Instrument.first.id, proficiency_level: 2 }, instjson = [{ id: Instrument.first.id, level: 2 },
{ instrument_id: Instrument.first(2)[1].id, proficiency_level: 2 } { id: Instrument.first(2)[1].id, level: 2 }
] ]
search.update_json_value(MusicianSearch::KEY_INSTRUMENTS, instjson) search.update_json_value(MusicianSearch::KEY_INSTRUMENTS, instjson)
expect(search.do_search.count).to eq(3) expect(search.do_search.count).to eq(3)
@ -286,28 +286,28 @@ describe 'Musician Search Model' do
selections.each do |hash| selections.each do |hash|
search.update_json_value(hash[:key], hash[:value]) search.update_json_value(hash[:key], hash[:value])
json_val = search.json_value(hash[:key]) json_val = search.json_value(hash[:key])
expect(search.description).to match(/; #{hash[:description]} = #{hash[:lookup][json_val]}/) expect(search.description).to match(/ #{hash[:description]} = #{hash[:lookup][json_val]}/)
end end
end end
it 'has correct description for genres' do it 'has correct description for genres' do
search.update_json_value(MusicianSearch::KEY_GENRES, [Genre.first.id, Genre.last.id]) search.update_json_value(MusicianSearch::KEY_GENRES, [Genre.first.id, Genre.last.id])
expect(search.description).to match(/; Genres = #{Genre.first.description}, #{Genre.last.description}/) expect(search.description).to match(/ Genres = #{Genre.first.description}, #{Genre.last.description}/)
end end
it 'has correct description for ages' do it 'has correct description for ages' do
search.update_json_value(MusicianSearch::KEY_AGES, [MusicianSearch::AGE_COUNTS[0],MusicianSearch::AGE_COUNTS[1]]) search.update_json_value(MusicianSearch::KEY_AGES, [MusicianSearch::AGE_COUNTS[0],MusicianSearch::AGE_COUNTS[1]])
expect(search.description).to match(/; Ages = #{MusicianSearch::AGES[MusicianSearch::AGE_COUNTS[0]]}, #{MusicianSearch::AGES[MusicianSearch::AGE_COUNTS[1]]}/) expect(search.description).to match(/ Ages = #{MusicianSearch::AGES[MusicianSearch::AGE_COUNTS[0]]}, #{MusicianSearch::AGES[MusicianSearch::AGE_COUNTS[1]]}/)
end end
it 'has correct description for instruments' do it 'has correct description for instruments' do
instrs = Instrument.limit(2).order(:description) instrs = Instrument.limit(2).order(:description)
instjson = [{ instrument_id: instrs[0].id, proficiency_level: 2 }, instjson = [{ id: instrs[0].id, level: 2 },
{ instrument_id: instrs[1].id, proficiency_level: 1 } { id: instrs[1].id, level: 1 }
] ]
search.update_json_value(MusicianSearch::KEY_INSTRUMENTS, instjson) search.update_json_value(MusicianSearch::KEY_INSTRUMENTS, instjson)
instr_descrip = "#{instrs[0].description} (#{MusicianSearch::INSTRUMENT_PROFICIENCY[2]}), #{instrs[1].description} (#{MusicianSearch::INSTRUMENT_PROFICIENCY[1]})" instr_descrip = "#{instrs[0].description} / #{MusicianSearch::INSTRUMENT_PROFICIENCY[2]}, #{instrs[1].description} / #{MusicianSearch::INSTRUMENT_PROFICIENCY[1]}"
expect(search.description).to match(/; Instruments = #{Regexp.escape(instr_descrip)}/) expect(search.description).to match(/ Instruments = #{Regexp.escape(instr_descrip)}/)
end end
end end