mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 14:46:05 +10:00
Fix UsersGroup specs
This commit is contained in:
@@ -18,7 +18,7 @@ class UsersGroup < ActiveRecord::Base
|
||||
attr_accessible :group_access, :user_id
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :project
|
||||
belongs_to :group
|
||||
|
||||
scope :guests, -> { where(group_access: GUEST) }
|
||||
scope :reporters, -> { where(group_access: REPORTER) }
|
||||
|
||||
@@ -13,10 +13,10 @@ describe UsersGroup do
|
||||
describe "Validation" do
|
||||
let!(:users_group) { create(:users_group) }
|
||||
|
||||
it { should validate_presence_of(:user) }
|
||||
it { should validate_presence_of(:user_id) }
|
||||
it { should validate_uniqueness_of(:user_id).scoped_to(:group_id).with_message(/already exists/) }
|
||||
|
||||
it { should validate_presence_of(:group) }
|
||||
it { should validate_presence_of(:group_id) }
|
||||
it { should ensure_inclusion_of(:group_access).in_array(UsersGroup.group_access_roles.values) }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user