diff options
author | Sean McGivern <sean@gitlab.com> | 2018-11-19 12:54:03 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-11-19 12:54:03 +0300 |
commit | c70c4038290f9898b516473413acfae362bc1627 (patch) | |
tree | bb434e5e869036d5ff9bb85c54e57d0eb3bb1b93 /spec/helpers | |
parent | 7a7060e0647bad9c5380068e50e912deecee2379 (diff) | |
parent | 2a5319832454fe40cfea151dd7b9e2aa520b3450 (diff) |
Merge branch '52385-search-bar-for-dashboard-list' into 'master'
Resolve "Search filter bar for issues dashboard list"
Closes #53584, #52430, and #52385
See merge request gitlab-org/gitlab-ce!22641
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/search_helper_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb index 8bfd520528f..4945749f524 100644 --- a/spec/helpers/search_helper_spec.rb +++ b/spec/helpers/search_helper_spec.rb @@ -135,5 +135,40 @@ describe SearchHelper do expect(search_filter_input_options('')[:data]['base-endpoint']).to eq("/groups#{group_path(@group)}") end end + + context 'dashboard' do + it 'does not include group-id and project-id' do + expect(search_filter_input_options('')[:data]['project-id']).to eq(nil) + expect(search_filter_input_options('')[:data]['group-id']).to eq(nil) + end + + it 'includes dashboard base-endpoint' do + expect(search_filter_input_options('')[:data]['base-endpoint']).to eq("/dashboard") + end + end + end + + describe 'search_history_storage_prefix' do + context 'project' do + it 'returns project full_path' do + @project = create(:project, :repository) + + expect(search_history_storage_prefix).to eq(@project.full_path) + end + end + + context 'group' do + it 'returns group full_path' do + @group = create(:group, :nested, name: 'group-name') + + expect(search_history_storage_prefix).to eq(@group.full_path) + end + end + + context 'dashboard' do + it 'returns dashboard' do + expect(search_history_storage_prefix).to eq("dashboard") + end + end end end |