correct spec to handle not null visibility_level

This commit is contained in:
Sam 2017-07-03 16:03:26 -04:00
parent 45c3ad5f91
commit 340a3ee5cb
2 changed files with 6 additions and 5 deletions

View File

@ -59,7 +59,11 @@ class Admin::GroupsController < Admin::AdminController
def save_group(group)
group.alias_level = group_params[:alias_level].to_i if group_params[:alias_level].present?
if group_params[:visibility_level]
group.visibility_level = group_params[:visibility_level]
end
grant_trust_level = group_params[:grant_trust_level].to_i
group.grant_trust_level = (grant_trust_level > 0 && grant_trust_level <= 4) ? grant_trust_level : nil

View File

@ -115,10 +115,7 @@ describe Admin::GroupsController do
end
it "ignore name change on automatic group" do
expect do
xhr :put, :update, { id: 1, group: { name: "WAT" } }
end.to change { GroupHistory.count }.by(1)
expect(response).to be_success
group = Group.find(1)