|
|
@ -134,26 +134,26 @@ describe 'Search', type: :feature, js: true, with_settings: { per_page_options: |
|
|
|
|
|
|
|
|
|
|
|
expect(current_path).to eql project_work_package_path(target_work_package.project, target_work_package, state: 'activity') |
|
|
|
expect(current_path).to eql project_work_package_path(target_work_package.project, target_work_package, state: 'activity') |
|
|
|
|
|
|
|
|
|
|
|
first_wp = work_packages.first |
|
|
|
search_target = work_packages.last |
|
|
|
|
|
|
|
|
|
|
|
# Typing a work package id shall find that work package |
|
|
|
# Typing a work package id shall find that work package |
|
|
|
global_search.search(first_wp.id.to_s, submit: false) |
|
|
|
global_search.search(search_target.id.to_s, submit: false) |
|
|
|
|
|
|
|
|
|
|
|
# And it shall be marked as the direct hit. |
|
|
|
# And it shall be marked as the direct hit. |
|
|
|
global_search.expect_work_package_marked(first_wp) |
|
|
|
global_search.expect_work_package_marked(search_target) |
|
|
|
|
|
|
|
|
|
|
|
# And the direct hit is opened when enter is pressed |
|
|
|
# And the direct hit is opened when enter is pressed |
|
|
|
global_search.submit_with_enter |
|
|
|
global_search.submit_with_enter |
|
|
|
|
|
|
|
|
|
|
|
expect(page) |
|
|
|
expect(page) |
|
|
|
.to have_selector('.subject', text: first_wp.subject) |
|
|
|
.to have_selector('.subject', text: search_target.subject) |
|
|
|
|
|
|
|
|
|
|
|
expect(current_path).to eql project_work_package_path(first_wp.project, first_wp, state: 'activity') |
|
|
|
expect(current_path).to eql project_work_package_path(search_target.project, search_target, state: 'activity') |
|
|
|
|
|
|
|
|
|
|
|
# Typing a hash sign before an ID shall only suggest that work package and (no hits within the subject) |
|
|
|
# Typing a hash sign before an ID shall only suggest that work package and (no hits within the subject) |
|
|
|
global_search.search("##{first_wp.id}", submit: false) |
|
|
|
global_search.search("##{search_target.id}", submit: false) |
|
|
|
|
|
|
|
|
|
|
|
global_search.expect_work_package_marked(first_wp) |
|
|
|
global_search.expect_work_package_marked(search_target) |
|
|
|
|
|
|
|
|
|
|
|
# Expect to have 3 project scope selecting menu entries |
|
|
|
# Expect to have 3 project scope selecting menu entries |
|
|
|
global_search.expect_scope('In this project ↵') |
|
|
|
global_search.expect_scope('In this project ↵') |
|
|
@ -163,7 +163,7 @@ describe 'Search', type: :feature, js: true, with_settings: { per_page_options: |
|
|
|
# Selection project scope 'In all projects' redirects away from current project. |
|
|
|
# Selection project scope 'In all projects' redirects away from current project. |
|
|
|
global_search.submit_in_global_scope |
|
|
|
global_search.submit_in_global_scope |
|
|
|
expect(current_path).to match(/\/search/) |
|
|
|
expect(current_path).to match(/\/search/) |
|
|
|
expect(current_url).to match(/\/search\?q=#{"%23#{first_wp.id}"}&work_packages=1&scope=all$/) |
|
|
|
expect(current_url).to match(/\/search\?q=#{"%23#{search_target.id}"}&work_packages=1&scope=all$/) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -400,7 +400,8 @@ describe 'Search', type: :feature, js: true, with_settings: { per_page_options: |
|
|
|
let(:wp_1) { FactoryBot.create :work_package, subject: "Foo && Bar", project: project } |
|
|
|
let(:wp_1) { FactoryBot.create :work_package, subject: "Foo && Bar", project: project } |
|
|
|
let(:wp_2) { FactoryBot.create :work_package, subject: "Foo # Bar", project: project } |
|
|
|
let(:wp_2) { FactoryBot.create :work_package, subject: "Foo # Bar", project: project } |
|
|
|
let(:wp_3) { FactoryBot.create :work_package, subject: "Foo &# Bar", project: project } |
|
|
|
let(:wp_3) { FactoryBot.create :work_package, subject: "Foo &# Bar", project: project } |
|
|
|
let!(:work_packages) { [wp_1, wp_2, wp_3] } |
|
|
|
let(:wp_4) { FactoryBot.create :work_package, subject: %(Foo '' "" \(\) Bar), project: project } |
|
|
|
|
|
|
|
let!(:work_packages) { [wp_1, wp_2, wp_3, wp_4] } |
|
|
|
let(:table) { Pages::EmbeddedWorkPackagesTable.new(find('.work-packages-embedded-view--container')) } |
|
|
|
let(:table) { Pages::EmbeddedWorkPackagesTable.new(find('.work-packages-embedded-view--container')) } |
|
|
|
|
|
|
|
|
|
|
|
let(:run_visit) { false } |
|
|
|
let(:run_visit) { false } |
|
|
@ -434,6 +435,16 @@ describe 'Search', type: :feature, js: true, with_settings: { per_page_options: |
|
|
|
global_search.submit_in_global_scope |
|
|
|
global_search.submit_in_global_scope |
|
|
|
table.expect_work_package_listed(wp_1, wp_3) |
|
|
|
table.expect_work_package_listed(wp_1, wp_3) |
|
|
|
table.ensure_work_package_not_listed! wp_2 |
|
|
|
table.ensure_work_package_not_listed! wp_2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global_search.search '""' |
|
|
|
|
|
|
|
global_search.find_option wp_4.subject |
|
|
|
|
|
|
|
global_search.submit_in_global_scope |
|
|
|
|
|
|
|
table.expect_work_package_listed(wp_4) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global_search.search "'" |
|
|
|
|
|
|
|
global_search.find_option wp_4.subject |
|
|
|
|
|
|
|
global_search.submit_in_global_scope |
|
|
|
|
|
|
|
table.expect_work_package_listed(wp_4) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|