Add tests for autocomplete on a Commit
This commit is contained in:
parent
a53e912bc0
commit
18b4291181
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue