summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-08-02 09:27:24 +0000
committerPhil Hughes <me@iamphill.com>2017-08-02 09:27:24 +0000
commit974a04026dd1043981c25e64c9827c3b8d15a927 (patch)
tree6911de2ce71ee949e224b593e5c8b693c4dd0eda /spec/helpers
parent6f66b19b939560a94cd2e89d94f203948ca2f2fb (diff)
downloadgitlab-ce-974a04026dd1043981c25e64c9827c3b8d15a927.tar.gz
Add filtered search to group issue dashboard
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/search_helper_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb
index b7e547dc1f5..4dab21440a6 100644
--- a/spec/helpers/search_helper_spec.rb
+++ b/spec/helpers/search_helper_spec.rb
@@ -68,4 +68,38 @@ describe SearchHelper do
end
end
end
+
+ describe 'search_filter_input_options' do
+ context 'project' do
+ before do
+ @project = create(:project, :repository)
+ end
+
+ it 'includes id with type' do
+ expect(search_filter_input_options('type')[:id]).to eq('filtered-search-type')
+ end
+
+ it 'includes project-id' do
+ expect(search_filter_input_options('')[:data]['project-id']).to eq(@project.id)
+ end
+
+ it 'includes project base-endpoint' do
+ expect(search_filter_input_options('')[:data]['base-endpoint']).to eq(project_path(@project))
+ end
+ end
+
+ context 'group' do
+ before do
+ @group = create(:group, name: 'group')
+ end
+
+ it 'does not includes project-id' do
+ expect(search_filter_input_options('')[:data]['project-id']).to eq(nil)
+ end
+
+ it 'includes group base-endpoint' do
+ expect(search_filter_input_options('')[:data]['base-endpoint']).to eq("/groups#{group_path(@group)}")
+ end
+ end
+ end
end