diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-14 18:41:13 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-14 18:41:13 +0400 |
commit | d20db103c1e187a324990c1b9f1d202f90ae5301 (patch) | |
tree | c72414912fa7326b7865420a2954370668a7e495 /spec | |
parent | eda5b3b1c52f6f68f516b6840ec35b230bb67e4a (diff) | |
parent | 97cf31c4cb36c4d7f259f768f04a8e995da1d278 (diff) |
Merge branch 'readding_group_member' of /home/git/repositories/gitlab/gitlabhq
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/group_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 4a08ad3bb15..12b84700eb1 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -42,4 +42,16 @@ describe Group do it { group.users_groups.masters.map(&:user).should include(user) } end + + describe :add_users do + let(:user) { create(:user) } + before { group.add_users([user.id], UsersGroup::GUEST) } + + it "should update the group permission" do + group.users_groups.guests.map(&:user).should include(user) + group.add_users([user.id], UsersGroup::DEVELOPER) + group.users_groups.developers.map(&:user).should include(user) + group.users_groups.guests.map(&:user).should_not include(user) + end + end end |