diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2016-11-27 22:35:44 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2016-11-28 14:48:03 +0500 |
commit | a4e41107005c538e0d6be342a2ba626f25816d37 (patch) | |
tree | 09c434c47677b22f5639ad72e83e39eb5dc16675 /spec/helpers | |
parent | 70d4d2fb27c80e64228d03a5375730cc3742ed45 (diff) | |
download | gitlab-ce-a4e41107005c538e0d6be342a2ba626f25816d37.tar.gz |
Refactor issuable_filters_present to reduce duplications
https://gitlab.com/gitlab-org/gitlab-ce/issues/23546
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/issuables_helper_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb index 62cc10f579a..a4f08dc4af0 100644 --- a/spec/helpers/issuables_helper_spec.rb +++ b/spec/helpers/issuables_helper_spec.rb @@ -114,4 +114,25 @@ describe IssuablesHelper do end end end + + describe '#issuable_filter_present?' do + it 'returns true when any key is present' do + allow(helper).to receive(:params).and_return( + ActionController::Parameters.new(milestone_title: 'Velit consectetur asperiores natus delectus.', + project_id: 'gitlabhq', + scope: 'all') + ) + + expect(helper.issuable_filter_present?).to be_truthy + end + + it 'returns false when no key is present' do + allow(helper).to receive(:params).and_return( + ActionController::Parameters.new(project_id: 'gitlabhq', + scope: 'all') + ) + + expect(helper.issuable_filter_present?).to be_falsey + end + end end |