BigW Consortium Gitlab

group_spec.rb 899 Bytes
Newer Older
1 2
# == Schema Information
#
Dmitriy Zaporozhets committed
3
# Table name: namespaces
4
#
Dmitriy Zaporozhets committed
5 6 7 8 9 10 11 12
#  id          :integer          not null, primary key
#  name        :string(255)      not null
#  path        :string(255)      not null
#  owner_id    :integer          not null
#  created_at  :datetime         not null
#  updated_at  :datetime         not null
#  type        :string(255)
#  description :string(255)      default(""), not null
13 14 15 16 17
#

require 'spec_helper'

describe Group do
18 19
  let!(:group) { create(:group) }

20 21 22
  it { should have_many :projects }
  it { should validate_presence_of :name }
  it { should validate_uniqueness_of(:name) }
Dmitriy Zaporozhets committed
23 24
  it { should validate_presence_of :path }
  it { should validate_uniqueness_of(:path) }
Andrey Kumanyaev committed
25
  it { should validate_presence_of :owner }
26 27

  describe :users do
28
    it { group.users.should == [group.owner] }
29 30 31 32 33
  end

  describe :human_name do
    it { group.human_name.should == group.name }
  end
34
end