Commit ea33df75 authored by Terri Chu's avatar Terri Chu Committed by Phil Hughes

Add file copy ability to code search results

parent e3516f9d
......@@ -5,6 +5,7 @@
= sprite_icon('document')
%strong
= search_blob_title(project, path)
= copy_file_path_button(path)
- if blob.data
.file-content.code.term{ data: { qa_selector: 'file_text_content' } }
= render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, blob_link: blob_link, highlight_line: blob.highlight_line
......@@ -172,8 +172,8 @@ RSpec.describe 'Global elastic search', :elastic, :sidekiq_inline do
select_search_scope('Code')
expect(page).to have_selector('.file-content .code')
expect(page).to have_selector("span.line[lang='javascript']")
expect(page).to have_button('Copy file path')
end
it 'ignores nonexistent projects from stale index' do
......
......@@ -58,6 +58,7 @@ RSpec.describe 'Group elastic search', :js, :elastic, :sidekiq_might_not_need_in
select_search_scope('Code')
expect(page).to have_selector('.file-content .code')
expect(page).to have_button('Copy file path')
end
end
......
......@@ -84,6 +84,7 @@ RSpec.describe 'Project elastic search', :js, :elastic do
select_search_scope('Code')
expect(page).to have_selector('.results', text: 'def username_regex')
expect(page).to have_button('Copy file path')
end
end
......
......@@ -22,6 +22,7 @@ RSpec.describe 'User searches for code' do
expect(page).to have_selector('.file-content .code')
expect(page).to have_selector("span.line[lang='javascript']")
expect(page).to have_link('application.js', href: %r{master/files/js/application.js})
expect(page).to have_button('Copy file path')
end
context 'when on a project page', :js do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment