diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-18 15:28:16 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-18 22:58:04 +0300 |
commit | b959ae553b1243e081d557b1e545d30830931e5b (patch) | |
tree | ce6c7410a97d93645fce4eb4ae77f1e8a1f9879b /spec/finders/groups_finder_spec.rb | |
parent | 0a7f7161198feaa9a4cae7c16669a0e6187aed33 (diff) |
Improve group visibility level feature
Diffstat (limited to 'spec/finders/groups_finder_spec.rb')
-rw-r--r-- | spec/finders/groups_finder_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb index d0fd7af8cc3..d5d111e8d15 100644 --- a/spec/finders/groups_finder_spec.rb +++ b/spec/finders/groups_finder_spec.rb @@ -2,11 +2,11 @@ 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 } + let(:user) { create(:user) } + let!(:private_group) { create(:group, :private) } + let!(:internal_group) { create(:group, :internal) } + let!(:public_group) { create(:group, :public) } + let(:finder) { described_class.new } describe 'execute' do describe 'without a user' do @@ -23,7 +23,8 @@ describe GroupsFinder do end context 'external user' do - before { user.update_attribute(external: true) } + let(:user) { create(:user, external: true) } + it { is_expected.to eq([public_group]) } end end |