diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-08 19:35:43 -0500 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-04-16 07:21:28 -0400 |
commit | a740f0bc99a67d25ed156353055de3b4fe0064a6 (patch) | |
tree | 4a74f1bbb77077bd01c2e99cb0a1ec80e5228c4f /spec | |
parent | 42848f2684c093c114abf20dd5d73a195ec6a451 (diff) | |
download | gitlab-ce-a740f0bc99a67d25ed156353055de3b4fe0064a6.tar.gz |
Add tests for autocomplete on a Issue
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/participants_autocomplete_spec.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/spec/features/participants_autocomplete_spec.rb b/spec/features/participants_autocomplete_spec.rb new file mode 100644 index 00000000000..f966fcbbfa1 --- /dev/null +++ b/spec/features/participants_autocomplete_spec.rb @@ -0,0 +1,53 @@ +require 'spec_helper' + +feature 'Member autocomplete', feature: true do + let(:project) { create(:project, :public) } + let(:user) { create(:user) } + let(:participant) { create(:user) } + let(:author) { create(:user) } + let(:issue) { create(:issue, author: author, project: project) } + + before do + login_as user + end + + describe 'On a Issue', js: true do + before do + create(:note, note: 'ultralight beam', noteable: issue, author: participant) + visit_issue(project, issue) + end + + describe 'adding a new note' do + describe 'when typing @' do + + before do + sleep 1 + page.within('.new-note') do + sleep 1 + find('#note_note').native.send_keys('@') + end + end + + it 'suggestions are displayed' do + expect(page).to have_selector('.atwho-view', visible: true) + end + + it 'author is a suggestion' do + page.within('.atwho-view', visible: true) do + expect(page).to have_content(author.username) + end + end + + it 'participant is a suggestion' do + page.within('.atwho-view', visible: true) do + expect(page).to have_content(participant.username) + end + end + end + end + end + + def visit_issue(project, issue) + visit namespace_project_issue_path(project.namespace, project, issue) + end +end |