2014-09-14 10:54:10 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Member do
|
|
|
|
describe "Associations" do
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to belong_to(:user) }
|
2014-09-14 10:54:10 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "Validation" do
|
|
|
|
subject { Member.new(access_level: Member::GUEST) }
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to validate_presence_of(:user) }
|
|
|
|
it { is_expected.to validate_presence_of(:source) }
|
|
|
|
it { is_expected.to validate_inclusion_of(:access_level).in_array(Gitlab::Access.values) }
|
2014-09-14 10:54:10 -04:00
|
|
|
end
|
2014-09-14 12:32:51 -04:00
|
|
|
|
|
|
|
describe "Delegate methods" do
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to respond_to(:user_name) }
|
|
|
|
it { is_expected.to respond_to(:user_email) }
|
2014-09-14 12:32:51 -04:00
|
|
|
end
|
2014-09-14 10:54:10 -04:00
|
|
|
end
|