require 'spec_helper'

describe Group, type: :model do
  subject(:group) { Fabricate.build(:group) }

  it { should belong_to(:chapter) }
  it { should have_many(:subscriptions) }
  it { should have_many(:members) }
  it { should have_many(:group_announcements) }
  it { should have_many(:announcements) }

  it { should respond_to(:name) }
  it { should respond_to(:description) }

  context 'validations' do
    it { should validate_presence_of(:name) }
    it do
      should validate_inclusion_of(:name).
        in_array(%w(Coaches Students)).
        with_message('Invalid name for Group')
    end
  end
end

require 'spec_helper'

describe Group, type: :model do
  subject(:group) { Fabricate.build(:group) }

  it { should respond_to(:name) }
  it { should respond_to(:description) }

  context 'validations' do
    it { should validate_presence_of(:name) }
    it do
      should validate_inclusion_of(:name).
        in_array(%w(Coaches Students)).
        with_message('Invalid name for Group')
    end
  end
end

Remove testing of active record associations
Remove testing of active record associations

 - 5 association tests in the 100s of possible associations
 - reproduces what rails has already tested
 - the source of truth is the model's rb file
   - it it's in the model's rb then it's working
