summaryrefslogtreecommitdiff
path: root/spec/models/members_spec.rb
blob: 6866c4794c28b9c8774077c005b9ed73ac8cc57e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe Member do
  describe "Associations" do
    it { should belong_to(:user) }
  end

  describe "Validation" do
    subject { Member.new(access_level: Member::GUEST) }

    it { should validate_presence_of(:user) }
    it { should validate_presence_of(:source) }
    it { should ensure_inclusion_of(:access_level).in_array(Gitlab::Access.values) }
  end

  describe "Delegate methods" do
    it { should respond_to(:user_name) }
    it { should respond_to(:user_email) }
  end
end