summaryrefslogtreecommitdiff
path: root/spec/features/search_spec.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-07-29 16:20:00 -0300
committerFelipe Artur <felipefac@gmail.com>2016-08-01 11:53:12 -0300
commit9845079950da010b8a4c07777f984aaf02642ad0 (patch)
tree097ad8578aa8316273c47fc7b0638c348f54be47 /spec/features/search_spec.rb
parentab3dd9a106787b70c26e55e9f0dc7fe6c34b0769 (diff)
downloadgitlab-ce-9845079950da010b8a4c07777f984aaf02642ad0.tar.gz
Fix search results for notes without commits
Diffstat (limited to 'spec/features/search_spec.rb')
-rw-r--r--spec/features/search_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb
index d0a301038c4..09f70cd3b00 100644
--- a/spec/features/search_spec.rb
+++ b/spec/features/search_spec.rb
@@ -28,6 +28,26 @@ describe "Search", feature: true do
end
context 'search for comments' do
+ context 'when comment belongs to a invalid commit' do
+ let(:note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'Bug here') }
+
+ before { note.update_attributes(commit_id: 12345678) }
+
+ it 'finds comment' do
+ visit namespace_project_path(project.namespace, project)
+
+ page.within '.search' do
+ fill_in 'search', with: note.note
+ click_button 'Go'
+ end
+
+ click_link 'Comments'
+
+ expect(page).to have_text("Commit deleted")
+ expect(page).to have_text("12345678")
+ end
+ end
+
it 'finds a snippet' do
snippet = create(:project_snippet, :private, project: project, author: user, title: 'Some title')
note = create(:note,