summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-11-28 11:37:53 +0000
committerRobert Speicher <robert@gitlab.com>2016-11-28 11:37:53 +0000
commit333e83a2ef29a0fce10b3e1b0110cd30685eea15 (patch)
tree9df60da3fbfb9c44b30756b90e9becb866b54a6c /spec
parent13c0039891fb33a6f3cf88e9c62e1d493a5f75da (diff)
parenta4e41107005c538e0d6be342a2ba626f25816d37 (diff)
downloadgitlab-ce-333e83a2ef29a0fce10b3e1b0110cd30685eea15.tar.gz
Merge branch 'issuable_filters_present-refactor' into 'master'
Refactor issuable_filters_present to reduce duplications See https://gitlab.com/gitlab-org/gitlab-ce/issues/23546 See merge request !7776
Diffstat (limited to 'spec')
-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