require 'spec_helper'

describe EventSession do

  it "should be creatable" do
    event = FactoryGirl.create(:event)
    event_session = FactoryGirl.create(:event_session, event: event)
  end

  it "requires a parent event" do
    event_session = FactoryGirl.build(:event_session)
    event_session.save.should be_false
    event_session.errors[:event].should == ["can't be blank"]
  end

  it "can't specify both band and user" do
    user = FactoryGirl.create(:user)
    band = FactoryGirl.create(:band)
    event = FactoryGirl.create(:event)
    event_session = FactoryGirl.build(:event_session, event: event, user: user, band:band)
    event_session.save.should be_false
    event_session.errors[:user].should == ["specify band, or user. not both"]
  end

end

