VRFS-2025 : Specs for video_sources park.

This commit is contained in:
Steven Miers 2014-10-06 17:02:33 -05:00
parent 1ce0ac34ef
commit 8ec75bb4e7
2 changed files with 35 additions and 3 deletions

View File

@ -711,5 +711,38 @@ describe ActiveMusicSession do
@music_session.get_connection_ids(exclude_client_id: @connection2.client_id, as_musician: true).should == [@connection1.client_id]
end
end
describe "join_the_session" do
let(:creator_1) { FactoryGirl.create(:user, last_jam_locidispid: 4, last_jam_audio_latency: 8) }
let(:creator_conn_1) { FactoryGirl.create(:connection, user: creator_1, ip_address: '4.4.4.4', locidispid: 4, addr:4) }
let!(:music_session_1) { FactoryGirl.create(:active_music_session, :creator => creator_1, genre: Genre.find('african'), language: 'eng', description: "Bunny Jumps" ) }
let(:tracks) { [{'sound' => 'mono', 'client_track_id' => 'abc', 'instrument_id' => 'piano'}] }
let(:videos) { [{'client_video_source_id' => 'abc'}] }
it "joins the session with no video" do
creator_conn_1.join_the_session(music_session_1.music_session, true, tracks, creator_1, 10)
creator_conn_1.errors.any?.should be_false
music_sessions = ActiveMusicSession.index(creator_1)
music_sessions.should_not be_nil
music_sessions.length.should == 1
music_sessions[0].connections.should have(1).items
music_sessions[0].connections.should have(1).items
music_sessions[0].connections[0].tracks.should have(1).items
music_sessions[0].connections[0].video_sources.should have(0).items
end
it "joins the session with video" do
creator_conn_1.join_the_session(music_session_1.music_session, true, tracks, creator_1, 10, videos)
creator_conn_1.errors.any?.should be_false
music_sessions = ActiveMusicSession.index(creator_1)
music_sessions.should_not be_nil
music_sessions.length.should == 1
creator_conn_1.video_sources.should have(1).items
music_sessions[0].connections.should have(1).items
music_sessions[0].connections[0].video_sources.should have(1).items
music_sessions[0].connections[0].tracks.should have(1).items
end
end
end

View File

@ -9,6 +9,8 @@ describe JamRuby::Connection do
:ip_address => "1.1.1.1",
:client_id => "1") }
let(:tracks) { [{'sound' => 'mono', 'client_track_id' => 'abc', 'instrument_id' => 'piano'}] }
it 'starts in the correct state' do
connection = FactoryGirl.create(:connection,
:user => user,
@ -101,7 +103,4 @@ describe JamRuby::Connection do
end
end
describe "join_the_session" do
end
end