summaryrefslogtreecommitdiff
path: root/spec/support/issuables_requiring_filter_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/issuables_requiring_filter_shared_examples.rb')
-rw-r--r--spec/support/issuables_requiring_filter_shared_examples.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/issuables_requiring_filter_shared_examples.rb b/spec/support/issuables_requiring_filter_shared_examples.rb
new file mode 100644
index 00000000000..439ef5ed92e
--- /dev/null
+++ b/spec/support/issuables_requiring_filter_shared_examples.rb
@@ -0,0 +1,15 @@
+shared_examples 'issuables requiring filter' do |action|
+ it "doesn't load any issuables if no filter is set" do
+ expect_any_instance_of(described_class).not_to receive(:issuables_collection)
+
+ get action
+
+ expect(response).to render_template(action)
+ end
+
+ it "loads issuables if at least one filter is set" do
+ expect_any_instance_of(described_class).to receive(:issuables_collection).and_call_original
+
+ get action, author_id: user.id
+ end
+end