require File.expand_path('../../../../../easy_extensions/test/spec/spec_helper', __FILE__)

describe EasyInvitation do

  let(:invitation) { FactoryGirl.create(:easy_invitation) }

  it 'is destroyed when user is destroyed' do
    invitation.user.destroy
    expect( EasyInvitation.find_by_id(invitation.id) ).to be_nil
  end

  it 'is destroyed when meeting is destroyed' do
    invitation.easy_meeting.reload.destroy
    expect( EasyInvitation.find_by_id(invitation.id) ).to be_nil
  end

end
