Commit 18b42911 authored by Alfredo Sumaran's avatar Alfredo Sumaran Committed by Jacob Schatz

Add tests for autocomplete on a Commit

parent a53e912b
......@@ -7,6 +7,7 @@ feature 'Member autocomplete', feature: true do
let(:author) { create(:user) }
before do
allow_any_instance_of(Commit).to receive(:author).and_return(author)
login_as user
end
......@@ -58,6 +59,23 @@ feature 'Member autocomplete', feature: true do
end
end
context 'adding a new note on a Commit ', js: true do
let(:commit) { project.commit }
before do
allow(commit).to receive(:author).and_return(author)
create(:note_on_commit, author: participant, project: project, commit_id: project.repository.commit.id, note: 'No More Parties in LA')
visit_commit(project, commit)
end
context 'when typing @' do
include_examples "open suggestions"
before do
open_member_suggestions
end
end
end
def open_member_suggestions
sleep 1
page.within('.new-note') do
......@@ -73,4 +91,8 @@ feature 'Member autocomplete', feature: true do
def visit_merge_request(project, merge)
visit namespace_project_merge_request_path(project.namespace, project, merge)
end
def visit_commit(project, commit)
visit namespace_project_commit_path(project.namespace, project, commit)
end
end
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