diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-01 12:22:29 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-10 10:38:36 -0300 |
commit | f2a9ee258e0ee3a6fe0cb614e4b73c56dcd7339d (patch) | |
tree | 84e668890ee51355f7ac9275012fbee3e295f5c4 /spec/finders | |
parent | 60ddd5ef34686e1ea9edc82a6915a9e4738bee50 (diff) | |
download | gitlab-ce-f2a9ee258e0ee3a6fe0cb614e4b73c56dcd7339d.tar.gz |
Add permission level to groups
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/groups_finder_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb new file mode 100644 index 00000000000..ed24954af7a --- /dev/null +++ b/spec/finders/groups_finder_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe GroupsFinder do + describe '#execute' do + let(:user) { create(:user) } + let!(:private_group) { create(:group, visibility_level: 0) } + let!(:internal_group) { create(:group, visibility_level: 10) } + let!(:public_group) { create(:group, visibility_level: 20) } + let(:finder) { described_class.new } + + describe 'execute' do + describe 'without a user' do + subject { finder.execute } + + it { is_expected.to eq([public_group]) } + end + + describe 'with a user' do + subject { finder.execute(user) } + + it { is_expected.to eq([public_group, internal_group]) } + end + end + end +end |