Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-03-23 17:27:15 +0300
committerWinnie Hellmann <winnie@gitlab.com>2018-04-03 21:19:09 +0300
commitc1b71e2fa1e49da82b15ee7f12148a372face09c (patch)
treec88dbf140e95c5d8f3cd6ea201e058a4cd1a1c0b /spec/support/issuables_requiring_filter_shared_examples.rb
parent59a158955e1ae09420ad05e53782e0dbc512e9c8 (diff)
Check if at least one filter is set on dashboard
When listing issues and merge requests on dasboard page, make sure that at least one filter is enabled. User's id is used in search autocomplete widget instead of username, which allows presetting user in filter dropdowns. Related to #43246
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