diff options
author | Rémy Coutable <remy@rymai.me> | 2019-09-02 11:58:00 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-09-02 11:58:00 +0300 |
commit | fc6f8a6a440518f6fc446f20a047ed52c5d5cebd (patch) | |
tree | a85efea3620e8252c71817bfa0e6ca47817d94e5 /spec/support/shared_examples/controllers | |
parent | b7398bc1fdad6c721cfa35ff17cebc2cb00c8240 (diff) |
Rename shared examples according to our guidelines
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support/shared_examples/controllers')
-rw-r--r-- | spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb b/spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb new file mode 100644 index 00000000000..ee25df00dfb --- /dev/null +++ b/spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +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, params: { author_id: user.id } + end +end |