Skip to content
Permalink
Browse files

DEV: Test if assign_allowed_on_groups contains only visible groups

Follow-up to 7d4b515.
  • Loading branch information...
nbianca committed Sep 11, 2019
1 parent d18c347 commit 927fdca0a01854ecf0d45ccfa2d4af8edfb2f333
Showing with 14 additions and 0 deletions.
  1. +14 −0 spec/requests/assign_controller_spec.rb
@@ -65,6 +65,20 @@

expect(suggestions).to contain_exactly(user.username)
end

it 'does include only visible assign_allowed_on_groups' do
visible_group = Fabricate(:group, members_visibility_level: Group.visibility_levels[:members])
visible_group.add(user)
invisible_group = Fabricate(:group, members_visibility_level: Group.visibility_levels[:members])

SiteSetting.assign_allowed_on_groups = above_min_version ? "#{visible_group.id}|#{invisible_group.id}"
: "#{visible_group.name}|#{invisible_group.name}"

get '/assign/suggestions.json'
assign_allowed_on_groups = JSON.parse(response.body)['assign_allowed_on_groups']

expect(assign_allowed_on_groups).to contain_exactly(visible_group.name)
end
end
end

0 comments on commit 927fdca

Please sign in to comment.
You can’t perform that action at this time.