require 'spec_helper'
require 'rest-client'

describe RecordedVideo do
  include UsesTempFiles
  let (:user)         {FactoryGirl.create(:user)}
  let (:connection)   {FactoryGirl.create(:connection, :user => user)}
  let (:music_session){FactoryGirl.create(:active_music_session, :creator => user, :musician_access => true)}
  let (:recording)    {FactoryGirl.create(:recording, :music_session => music_session, :owner => user)}
  let (:video_source) {FactoryGirl.create(:video_source, :connection => connection)}

  it "should create from a video source" do
    recorded_video_source = RecordedVideo.create_from_video_source(video_source, recording)
    recorded_video_source.should_not be_nil
    recorded_video_source.user.id.should == video_source.connection.user.id
    recorded_video_source.fully_uploaded.should == false
    recorded_video_source.client_video_source_id.should == video_source.client_video_source_id
  end
    
end

