diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/lib/event_filter_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/event_filter_spec.rb')
-rw-r--r-- | spec/lib/event_filter_spec.rb | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/spec/lib/event_filter_spec.rb b/spec/lib/event_filter_spec.rb index da6e1f9458f..bab48796b8c 100644 --- a/spec/lib/event_filter_spec.rb +++ b/spec/lib/event_filter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EventFilter do +RSpec.describe EventFilter do describe '#filter' do it 'returns "all" if given filter is nil' do expect(described_class.new(nil).filter).to eq(described_class::ALL) @@ -30,6 +30,7 @@ describe EventFilter do let_it_be(:left_event) { create(:event, :left, project: public_project, target: public_project) } let_it_be(:wiki_page_event) { create(:wiki_page_event) } let_it_be(:wiki_page_update_event) { create(:wiki_page_event, :updated) } + let_it_be(:design_event) { create(:design_event) } let(:filtered_events) { described_class.new(filter).apply_filter(Event.all) } @@ -79,15 +80,13 @@ describe EventFilter do it 'returns all events' do expect(filtered_events).to eq(Event.all) end + end - context 'the :wiki_events filter is disabled' do - before do - stub_feature_flags(wiki_events: false) - end + context 'with the "design" filter' do + let(:filter) { described_class::DESIGNS } - it 'does not return wiki events' do - expect(filtered_events).to eq(Event.not_wiki_page) - end + it 'returns only design events' do + expect(filtered_events).to contain_exactly(design_event) end end @@ -97,16 +96,6 @@ describe EventFilter do it 'returns only wiki page events' do expect(filtered_events).to contain_exactly(wiki_page_event, wiki_page_update_event) end - - context 'the :wiki_events filter is disabled' do - before do - stub_feature_flags(wiki_events: false) - end - - it 'does not return wiki events' do - expect(filtered_events).not_to include(wiki_page_event, wiki_page_update_event) - end - end end context 'with an unknown filter' do @@ -115,16 +104,6 @@ describe EventFilter do it 'returns all events' do expect(filtered_events).to eq(Event.all) end - - context 'the :wiki_events filter is disabled' do - before do - stub_feature_flags(wiki_events: false) - end - - it 'does not return wiki events' do - expect(filtered_events).to eq(Event.not_wiki_page) - end - end end context 'with a nil filter' do @@ -133,16 +112,6 @@ describe EventFilter do it 'returns all events' do expect(filtered_events).to eq(Event.all) end - - context 'the :wiki_events filter is disabled' do - before do - stub_feature_flags(wiki_events: false) - end - - it 'does not return wiki events' do - expect(filtered_events).to eq(Event.not_wiki_page) - end - end end end |