require 'spec_helper'

describe MusicSessionHistory do

  let(:some_user) { FactoryGirl.create(:user) }
  let(:music_session) { FactoryGirl.create(:music_session) }
  let(:history) { FactoryGirl.create(:music_session_history, :music_session => music_session) }
  let(:user_history1) { FactoryGirl.create(:music_session_user_history, :history => history, :user => music_session.creator) }
  let(:user_history2) { FactoryGirl.create(:music_session_user_history, :history => history, :user => some_user) }

  it "create" do
    history.description.should eql(music_session.description)
  end

  it "unique users" do
    user_history1.should_not be_nil
    user_history2.should_not be_nil
    users = history.unique_users

    users.length.should eql(2)

    users.include?(some_user).should be_true
    users.include?(music_session.creator).should be_true
  end

end


