FIX: wasn't able to remove a user's primary group

This commit is contained in:
Régis Hanol
2017-08-04 18:13:20 +02:00
parent 519b70ea46
commit 3c0de22bf0
2 changed files with 22 additions and 4 deletions

View File

@ -228,6 +228,13 @@ describe Admin::UsersController do
@another_user.reload
expect(@another_user.primary_group_id).to be_nil
end
it "remove user's primary group" do
group.add(@another_user)
xhr :put, :primary_group, user_id: @another_user.id, primary_group_id: ""
@another_user.reload
expect(@another_user.primary_group_id).to be(nil)
end
end
context '.trust_level' do