summaryrefslogtreecommitdiff
path: root/spec/helpers/issuables_helper_spec.rb
diff options
context:
space:
mode:
authorSemyon Pupkov <mail@semyonpupkov.com>2016-11-27 22:35:44 +0500
committerSemyon Pupkov <mail@semyonpupkov.com>2016-11-28 14:48:03 +0500
commita4e41107005c538e0d6be342a2ba626f25816d37 (patch)
tree09c434c47677b22f5639ad72e83e39eb5dc16675 /spec/helpers/issuables_helper_spec.rb
parent70d4d2fb27c80e64228d03a5375730cc3742ed45 (diff)
downloadgitlab-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/issuables_helper_spec.rb')
-rw-r--r--spec/helpers/issuables_helper_spec.rb21
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