Add tests for autocomplete on a Commit

This commit is contained in:
Alfredo Sumaran 2016-04-13 13:50:17 -05:00 committed by Jacob Schatz
parent a53e912bc0
commit 18b4291181

View file

@ -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